HTML Block And Inline - Free Tutorial To Learn HTML And CSS
Có thể bạn quan tâm
In HTML, you’ll mainly come across 2 types of HTML elements:
-
block elements like:
- paragraphs <p>
- lists: unordered (with bullet points) <ul> or ordered lists (with numbers) <ol>
- headings: from 1st level <h1> to 6th level headings <h6>
- articles <article>
- sections <section>
- long quotes <blockquote>
-
inline elements like:
- links <a>
- emphasised words <em>
- important words <strong>
- short quotes <q>
- abbreviations <abbr>
Block elements are meant to structure the main parts of your page, by dividing your content in coherent blocks.
Inline elements are meant to differentiate part of a text, to give it a particular function or meaning. Inline elements usually comprise a single or few words.
Opening and closing tags
All block-level elements have an opening and closing tags.
As a result, self-enclosing elements are inline elements, simply because their syntax don’t allow them to contain any other HTML element.
Have opening and closing tags | Self-enclosing | |
---|---|---|
Block elements | <p> </p> <ul> </ul> <ol> </ol> | Impossible |
Inline elements | <a> </a> <strong> </strong> <em> </em> | <input> <br> <img> |
Other types of HTML elements
There are several exceptions to the block/inline elements, but the ones you will most often encounter are:
- list items for the <li>
- table, table rows, table cells for <table>, <tr> and <td> respectively
Từ khóa » Html Block Elements Display
-
Every HTML Element Has A Default Display Value, Depending On What Type Of Element It Is. There Are Two Display Values: Block And Inline. ... HTML Tags.
-
Block-level Elements - HTML: HyperText Markup Language | MDN
-
HTML - Blocks - Tutorialspoint
-
Block And Inline Elements
-
HTML Block Level, Inline Elements - HTML Tutorials - W3resource
-
CSS Inline Vs Inline-Block Vs Block
-
Basic HTML: Block-level, Inline, And Organizational Elements
-
HTML Blocks - Dofactory
-
Inline And Block Elements In HTML - Scaler Topics
-
HTML Block And Inline Level Elements Difference - Tech Altum Tutorial
-
HTML Block And Inline Elements
-
HTML Block And Inline Elements - GeeksforGeeks
-
HTML Block And Inline Elements - DataFlair
-
How Does Block Display In HTML With Examples? - EduCBA