溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

H5中語義化標(biāo)簽新特性的用法

發(fā)布時間:2020-09-28 15:33:10 來源:億速云 閱讀:117 作者:小新 欄目:web開發(fā)

小編給大家分享一下H5中語義化標(biāo)簽新特性的用法,希望大家閱讀完這篇文章后大所收獲,下面讓我們一起去探討吧!

HTML5新特性

簡潔的DOCTYPE:

HTML5 只有一個簡單的文檔類型:<!DOCTYPE html>,表示瀏覽器會按照標(biāo)準(zhǔn)模式解析。

簡單易記的編碼類型

你現(xiàn)在可以在meta 標(biāo)簽中使用”charset”:<meta charset=”utf-8″ />

腳本和鏈接無需type

<link rel="stylesheet" href="path/to/stylesheet.css" />
<script src="path/to/script.js"></script>

更加語義化的新增標(biāo)簽

比如說:<article>、<section>、<aside>、<hgroup>、 <header>,<footer>、<nav>、<time>、<mark>、<figure> 和<figcaption>等

<video width="640" height="320" preload="auto" poster="0.jpg" controls>
    <source src="movie.ogg" type="video/ogg" />
    <source src="movie.mp4" type="video/mp4" />
    Your browser does not support the video tag.
</video>

表單增強

新的input類型:

color, email, date, month, week, time, datetime, datetime-local, number,range,search, tel, 和url

新屬性:

required, autofocus, pattern, list, autocomplete 和placeholder

新元素:<keygen>, <datalist>, <output>, <meter> 和<progress>

canvas標(biāo)簽繪制2D圖形。

var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
context.beginPath();
context.moveTo(100,100);
context.lineTo(300,300);
context.lineTo(100,500);
context.lineWidth = 5;
context.strokeStyle = "red";
context.stroke();

看完了這篇文章,相信你對H5中語義化標(biāo)簽新特性的用法有了一定的了解,想了解更多相關(guān)知識,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI