A directory

What’s the difference between a free front end and a salted fish

directory
A directory
Two HTML tags
Semantic structure
 3.1 Why semantic
 3.2 Semantic structure
 3.3 the head
 3.4 Main Contents
 3.5 the footer
Four-level relationship
Substitutable elements and non-substitutable elements
 5.1 Replacing Elements
 5.2 Non-replaceable elements
Six-row elements and block-level elements
 6.1 Common block-level elements
 6.2 Common inline elements
 6.3 Inline element and block-level element conversions
Vii References

Two HTML tags

Returns the directory

Common HTML5 tags are:

  • <section>– section
  • <nav>Navigation –
  • <article>– Complete independent content block
  • <aside>– Content that is less relevant to the page content: such as ads (remaining)
  • <header>– Page or article header
  • <footer>– End of page or text
  • <main>– Document content
  • <figure>– A legend related to the document
  • <figcaption>– Legend description
  • <mark>– Quotes that need to be highlighted
  • <video>– video
  • <audio>– the audio
  • <source>– forvideoaudioThe specifiedMedia sources
  • <track>– forvideoaudioThe specifiedText orbitsubtitle
  • <canvas>– Bitmap area
  • <svg>– the vector diagram
  • <progress>– the progress bar
  • <meter>– slider

Semantic structure

Returns the directory

HTML has an honorable task:

  • The content of the page can be expressed clearly and structurally without CSS.

So, when you build a page structure, you need to think about semantics.

3.1 Why semantic

Returns the directory

  • Easy to modify and maintain
  • Accessible Reading support
  • Search engines are good for SEO
  • For future-oriented HTML, browsers may offer richer support in the future

3.2 Semantic structure

Returns the directory

<! - the head -- -- >
<header>
  <nav></nav>
</header>

<! -- Content area -->
<main>
  <! The left -- -- -- >
  <article>
    <! -- Left title -->
    <header></header>
    <! -- Image block -->
    <figure>
      <img>
      <figcaption></figcaption>
    </figure>
  </article>

  <! - right - >
  <aside>
    <! -->
    <nav></nav>
    <section></section>
  </aside>
</main>

<! -- -- -- > at the bottom of the
<footer></footer>
Copy the code

3.3 the head

Returns the directory

is used to represent the header of a web page.

The header information area can contain content information such as the

3.4 Main Contents

Returns the directory


specifies all contents except

and

:

  • <aside>: Can store ads, search content, share links, etc
  • <section>: Forms, lists, article blocks, etc
  • <article>: represents a complete, self-contained block of content. Such as articles or news reports.
  • <figure>: Article illustration block
  • <figcaption>: Notes on article illustrations

3.5 the footer

Returns the directory

The

tag can contain text or link information, such as copyright, source information, legal restrictions, etc.

Four-level relationship

Returns the directory

Docoment, Window, HTML, body hierarchy:

window > document > html > body
Copy the code
  • windowBOMIs used to get and set browser properties and behavior, and as a global object.
  • documentObject is a document-related object that has some functionality for manipulating document content, but no statuswindowHigh.
  • htmlThe element object followsdocumentThe element object belongs tohtmlThe documentDOMObject, you can think of it ashtmlThe objects that are labeled in the source code, they look likediv,selectThere is no fundamental difference between these objects.

Substitutable elements and non-substitutable elements

Returns the directory

Although and are inline elements, they can be set to width and height because they involve replaceable and non-replaceable elements.

5.1 Replacing Elements

Returns the directory

Replacing elements is when the browser decides what to display an element based on its tags and attributes.

Such as:

  • <img>According to thesrcProperty to read picture information and display it
  • <input>According to the labeltypeProperty to determine whether to display an input field or a radio button.

The replacement elements are: , , .

5.2 Non-replaceable elements

Returns the directory

Most elements of HTML are non-replaceable, meaning their content is presented directly to the browser.

Such as:

  • <p>Direct full display

Six-row elements and block-level elements

Returns the directory

Overall comparison:

Block-level elements Inline elements
Exclusive line. By default the width fills the parent element width automatically Width varies with element content. Elements in adjacent rows are arranged in the same row until there is no more space in the row.
You can set thewidth,height Set up thewidth,heightinvalid
You can set themarginpadding You can set themargin-left,margin-right,padding-left,padding-right
Corresponding:display: block The correspondingdisplay: inline

6.1 Common block-level elements

Returns the directory

  • <div>– label block
  • <h1>,<h2>,<h3>,<h4>,<h5>,<h6>– Heading 1 – Heading 6
  • <form>– the form
  • <hr>– the horizontal line
  • <ul>– Unordered list
  • <ol>– Ordered list
  • <li>– Defines list items forulli
  • <p>– paragraph
  • <table>,<thead>,<tbody>,<thead>,<th>,<tr>,<td>– Table elements

6.2 Common inline elements

Returns the directory

  • <a>– Hyperlinks or anchors
  • <b>– Bold font
  • <br>– a newline
  • <code>– Defines computer code text
  • <i>– italics
  • <img>Pictures –
  • <input>– input box
  • <label>– forinputMark/label
  • <button>– button
  • <textarea>– Multi-line text box

6.3 Inline element and block-level element conversions

Returns the directory

The display attribute enables conversions between inline and block-level elements.

  • display: inline– Converts to inline elements
  • display: block– Converts to block-level elements
  • display: inline-block– Converts to inline block elements

Vii References

Returns the directory

Eight articles are referenced in this series.

  • Mdn-html5 tag list【 Reading Suggestions: 5min】
  • Html5 semantic tags【 Reading Suggestions: 5min】
  • Block-level elements and inline element summaries【 Reading Suggestions: 5min】
  • The difference between inline and block-level elements in HTML【 Reading Suggestions: 5min】
  • Mdn-html5 tag list【 Reading Suggestions: 5min】
  • Html5 semantic tags【 Reading Suggestions: 5min】
  • Block-level elements and inline element summaries【 Reading Suggestions: 5min】
  • The difference between inline and block-level elements in HTML【 Reading Suggestions: 5min】

Jsliang’s document library is licensed by Junrong Liang under the Creative Commons Attribution – Non-commercial – Share alike 4.0 International License. Based on the github.com/LiangJunron… On the creation of works. Outside of this license agreement authorized access can be from creativecommons.org/licenses/by… Obtained.