Table of Contents
Previous words
h
other
[Default style]
 
其他
最后
Home Web Front-end HTML Tutorial Detailed description of HTML block-level elements

Detailed description of HTML block-level elements

Mar 15, 2017 pm 12:48 PM
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,&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='brush:php;toolbar:false;'&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> 

最后

<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!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Is HTML easy to learn for beginners? Is HTML easy to learn for beginners? Apr 07, 2025 am 12:11 AM

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 Roles of HTML, CSS, and JavaScript: Core Responsibilities The Roles of HTML, CSS, and JavaScript: Core Responsibilities Apr 08, 2025 pm 07:05 PM

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.

Understanding HTML, CSS, and JavaScript: A Beginner's Guide Understanding HTML, CSS, and JavaScript: A Beginner's Guide Apr 12, 2025 am 12:02 AM

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

Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Apr 04, 2025 pm 11:54 PM

GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...

What is an example of a starting tag in HTML? What is an example of a starting tag in HTML? Apr 06, 2025 am 12:04 AM

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? Apr 05, 2025 am 06:15 AM

To achieve the effect of scattering and enlarging the surrounding images after clicking on the image, many web designs need to achieve an interactive effect: click on a certain image to make the surrounding...

HTML, CSS, and JavaScript: Essential Tools for Web Developers HTML, CSS, and JavaScript: Essential Tools for Web Developers Apr 09, 2025 am 12:12 AM

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

How to distinguish between closing a browser tab and closing the entire browser using JavaScript? How to distinguish between closing a browser tab and closing the entire browser using JavaScript? Apr 04, 2025 pm 10:21 PM

How to distinguish between closing tabs and closing entire browser using JavaScript on your browser? During the daily use of the browser, users may...

See all articles