html_3
主要是学习body中的元素,包括但不限于h元素等学习
refer
- html mdn
https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/HTML_text_fundamentals
P和H
我们经常会使用p元素和h元素进行文章的书写,例子如下:
<h1>The Crushing Bore</h1>
<p>By Chris Mills</p>
<h2>Chapter 1: The dark night</h2>
<p>It was a dark night. Somewhere, an owl hooted. The rain lashed down on the ...</p>
<h2>Chapter 2: The eternal silence</h2>
<p>Our protagonist could not so much as a whisper out of the shadowy figure ...</p>
<h3>The specter speaks</h3>
<p>Several more hours had passed, when all of a sudden the specter sat bolt upright and exclaimed, "Please have mercy on my soul!"</p>
span元素
无实意,例子如下:
<span style="font-size: 32px; margin: 21px 0; display: block;">Is this a top level heading?</span>
ul元素和ol元素
list有两种,分别是无序unordered和有序ordered的,其中无序的是不会标记1,2,3,4等,而有序的会标记1,2,3,4等
使用ul(unodered list)元素完成无序,使用ol完成有序,例子如下
<p>unordered</p>
<ul>
<li>milk</li>
<li>eggs</li>
<li>bread</li>
<li>hummus</li>
</ul>
<p>ordered</p>
<ol>
<li>Drive to the end of the road</li>
<li>Turn right</li>
<li>Go straight across the first two roundabouts</li>
<li>Turn left at the third roundabout</li>
<li>The school is on your right, 300 meters up the road</li>
</ol>
em元素
em元素用于嵌套在p元素中,完成对某一段文字的倾斜工作。例子如下:
<p>I am <em>glad</em> you weren't <em>late</em>.</p>
strong元素
strong元素用于嵌套在p元素中,完成对某一段文字重点突出的工作,例子如下:
<p>This liquid is <strong>highly toxic</strong>.</p>
<p>I am counting on you. <strong>Do not</strong> be late!</p>
html5
html5的元素使用会大相径庭