Detailed description of HTML block-level elements
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,< ;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;
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>
margin: 16px 0;
<p>段落1</p>
<p>段落2</p>
<p>段落3</p>
Copy after login
<p>margin: 16px 0; <p>段落1</p> <p>段落2</p> <p>段落3</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>
[Default style]
margin: 8px 0; border-style: inset; border-width: 1px;
pre <p> <pre class="brush:php;toolbar:false"></code> 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.<code><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><pre class="brush:php;toolbar:false">
body {
color:red;
}
</pre></pre><div class="contentsignin">Copy after login</div></div>
[Default style]margin: 1em 0; white-space: pre;
<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>
[Default style]
margin: 1em 40px;
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;
其他
<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>
最后
<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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.
