Detailed description of HTML block-level elements

高洛峰
Release: 2017-03-15 12:48:54
Original
1708 people have browsed it
<h2>Previous words <p>  Before HTML5 appeared, people generally divided elements into block-level, inline and inline block elements. This article will introduce the HTML block-level elements in detail

<p>

h

<p> The title (Heading) element has six different levels,&lt ;h1> is the highest level, while <h6> is the lowest. A title element that briefly describes the topic of the section

<p>  From <h1> to <h6>, the importance gradually decreases and the font size decreases Small. When using title elements, pay attention to the following points

<p> 1. Do not use low-level titles in order to reduce the font of the title. Instead, use CSS font-sizestyle

<p>   2. Avoid skipping certain levels of headings: always start with <h1>, then use <h2> etc.

<p>   3 , when using the <section> element, for the sake of convenience, to avoid repeated use of <h1> on one page, <h1> should be used Indicates the title of the page. Other titles should start from <h2>. When using <section>, each section should use a <h2>

##[Default style]<p>

//从h1到h6
margin: 0.67em 0 -> 0.83em 0 -> 1em 0 -> 1.33em 0 -> 1.67em 0 -> 2.33em 0;
font-size: 2em -> 1.5em -> 1.17em -> 1em -> 0.83em -> 0.67em;
font-weight: bold;
Copy after login
  HTML5<p>New
tag, which represents the title group, is used to combine titles. It is only used when the block needs to have multiple levels of titles
<hgroup>
    <h1>水果</h1>
    <h2>苹果</h2>
</hgroup>
Copy after login

# The element (paragraph) represents a paragraph of text. This element usually appears as a whole block of text separated from adjacent text, or as Vertical white space isolation or first line indentation<p>

[Default style]

margin: 16px 0;

<p>段落1</p>
<p>段落2</p>
<p>段落3</p>
Copy after login

<p>p

  <p><p>

The element (pide) (or <p>HTML document

partitioning element) is a general-purpose container for streaming content. It does not semantically represent any specific type of content. It can be used to

other

Elements are <p> grouped, generally used for styling-related needs (using class or id attributes) or to group a set of elements with the same characteristics (such as lang), which should be used only when no other semantic elements are available (such as <article> or <nav>) # The ##hr ÷ <hr> element represents a thematic transition between paragraph-level elements (for example, a change in scene within a story, or a change in the theme of a chapter). In early versions of HTML, it was a horizontal line. It still appears as a horizontal line in visual browsers, but is currently defined semantically rather than presentationally. Split, there is no need to use

<hr><p> to split between blocks

<p>段落1</p>
<hr>
<p>段落2</p>
Copy after login

[Default style]

margin: 8px 0;
border-style: inset;
border-width: 1px;
Copy after login
<p> pre

<p>  <pre class="brush:php;toolbar:false">&lt;/code&gt; element represents pre-formatted text. The text in this element is usually displayed in a fixed-width font according to the format in the original file. Whitespace characters (such as spaces and line breaks) in the text will be displayed, usually indicating typesetting content, such as code blocks and Character painting, etc.&lt;code&gt;&lt;div class=&quot;code&quot; style=&quot;position:relative; padding:0px; margin:0px;&quot;&gt;&lt;pre class=&quot;brush:html;toolbar:false;&quot;&gt;&lt;pre class=&quot;brush:php;toolbar:false&quot;&gt; body { color:red; } </pre></pre><div class="contentsignin">Copy after login</div></div>[Default style]

margin: 1em 0;
white-space: pre;
Copy after login
<p>

<p>blockquote

 

<blockquote><p> element (or HTML block level Quote element), which means that the text in it is the quoted content. Usually when rendering, the content of this part will be indented to a certain extent. If the citation comes from the Internet, you can set the source URL address of the original content to the cite attribute. If you want to inform readers of the source of the citation in the form of text, you can use the

<p> element

<p>  [Note] The signature of the citation must be defined outside the citation

<blockquote cite="http://baike.baidu.com/view/921793.htm">
  <p>横眉冷对千夫指,俯首甘为孺子牛</p>
</blockquote>    
<p>鲁迅</p>
Copy after login

[Default style]

margin: 1em  40px;
Copy after login
<p> address   < The address> element allows the author to provide contact information for its nearest

<article><p> or

<body><p> ancestor element. In the latter case, it applies to the entire document

<p>  当表示一个和联系信息无关的任意的地址时,使用<p>元素而不是<address>元素。这个元素不能包含除了联系信息之外的任何信息,比如出版日期(这应该包含在<<a href="http://www.php.cn/wiki/1268.html" target="_blank">time</a>>元素中)。通常,<address>元素可以放在当前section的<footer>元素中,如果存在的话

<p>【默认样式】

font-style: italic;
Copy after login

<p> 

其他

<p>  除了上面介绍的<p><h><p><hr><blockquote><address>标签外,还有一些前面已经介绍过的标签属于块级标签

<p>  包括骨架类标签(<html><body>),列表类标签(<ul><ol><<a href="http://www.php.cn/wiki/596.html" target="_blank">dl</a>><dd><dt>),表单类标签(<a href="http://www.php.cn/wiki/125.html" target="_blank">for</a>m<fieldset><output><legend><optgroup><option>),HTML5新增的结构标签(<article><aside><header><footer><nav><section>),HTML5新增的多媒体标签(<figure><figcaption>),HTML5新增的功能性标签(<summary><details>)

<p> 

<h2>最后 <p>  可能有人会觉得<br>标签应该是一个块级元素,因为它有换行,与块级元素的特征很相似。但它实际上是一个内联元素,它的用途是在文本中产生一个换行

The above is the detailed content of Detailed description of HTML block-level elements. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!