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 <!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>
sign Description |
##<
canvas>
DrawingAPI | #labelsign Description list> Define the option list. Please use this element in conjunction with the input element to define the input possible values. ## LabelTag Description 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 ## ##Definition Dialog box, such as prompt box ## details title of the element # # document footer. # ## Define text with tokens. # ##Define the progress of any type of task. # ##Definition ruby comments to define the content displayed by browsers that do not support the ruby element. 定义文档中的节(section、区段)。 <time> 定义日期或时间。 规定在文本中的何处适合添加换行符。 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! |