Home > Article > Web Front-end > HTML5 first look at 2 new elements
1. Block element
##HTML5 defines 8 new HTML semantic (semantic) elements, these elements are block-level elements. In order to allow older versions of browsers to display these elements correctly, you can set the CSS##display property to block:header, section, footer, aside, nav, main, article,figure{
display: block;
}
Add new element
Add a new element toHTML, and define the style and element name for the element For 523a75af872c9b7da9495f252f14cbcb##:<!DOCTYPE html>
<html>
<head>
<title>Creating an HTML Element</title>
<script>document.createElement("myHero")</script>
<style>
myHero {
display: block;
background-color: #ddd;
padding: 50px;
font-size: 30px;
}
</style>
</head>
<body>
<h1>我的第一个标题</h1>
<p>我的第一个段落。</p>
<myHero>我的第一个新元素</myHero>
</body>
</html>
3.
sign Description |
|
##DefinitionAudio Content |
39000f942b2545a5315c57fa3276f220 |
DefinitionVideo ( |
video | e02da388656c3265154666b7c71a8ddc
##Define multimedia resources 39000f942b2545a5315c57fa3276f220 | and b97864c2e0ef2353a16c4d64c7734e92#d8e2720730be5ddc9c2a3782839e8eb6 |
Define embedded content, such as plug-ins. |
#9bf7cbf2c39baa37076a22499de2f6ed |
##Specify external text tracks for media such as 39000f942b2545a5315c57fa3276f220 and b97864c2e0ef2353a16c4d64c7734e92 |
elements. ##4. Canvas ElementElement |
##ea79ed816fc39437ed76490f1991cc74
DrawingAPI | #labelsign Description 8ea4c07ce459fbda8851893664118a5a Define the option list. Please use this element in conjunction with the input element to define the input possible values. ##Define different types of output, such as script output.
## LabelTag Description 23c3de37f2f9ebcb477c4a90aac6fffd
Allows you to set a piece of text independent of the text direction setting of its parent element. Define command , checkbox or button ##Details used to describe a document or a certain part of a document ##a38fd2622755924ad24c0fc5f0b4d412 ##Definition Dialog box, such as prompt box ##631fb227578dfffda61e1fa4d04b7d25 details title of the element #24203f2f45e6606542ba09fd2181843a #614eb9dc63b3fb809437a716aa228d24 The title of the element ##< ;footer> document footer. #1aa9e5d373740b65a0cc8f0a02150c53 ##Defines the header area of the document ##f920514e6447cf1d171079d1371f007f Define text with tokens. #49c6123c49c6be380cb91db06cd3bfa9 ##Define the running progress (process). ##Define the progress of any type of task. #ec41f2147470148e85ad0337a362103e ##Definition ruby ## Define the interpretation or pronunciation of characters (Chinese phonetic symbols or characters). comments to define the content displayed by browsers that do not support the ruby element. 定义文档中的节(section、区段)。 865ebc4a8f40017839ddd62af936776f 定义日期或时间。 37fcc81822f151c26d66e5caf9953670 规定在文本中的何处适合添加换行符。 7. 已移除的元素 在HTML5中不再使用,已经被删除。 |
The above is the detailed content of HTML5 first look at 2 new elements. For more information, please follow other related articles on the PHP Chinese website!