Learn H5-inline elements, block-level elements, replacement elements

Learn H5-inline elements, block-level elements, replacement elements

How to apply the elements in HTML:

  • Block-level elements can be applied to everything
  • Inline elements cannot be applied to block-level elements, only inline elements and replacement elements can be applied
  • Replacement elements can only be applied to replacement elements
  • Replacement elements and nesting of inline elements are in no order, and block-level elements are from large to small

Block-level elements:

Features:

  • Own a line
  • You can set the width and height

common:

<div>, <p>, <table>, <h1~6>, <ul><li>, <ol><li>, <hr>
can see the following example diagram:

Inline elements:

Features:

  • Won't monopolize the whole line
  • Cannot set width and height

common:

<a>, <b>, <i>, <u>, <del>, <font>, <input>, <textarea>, <select><option>, <button>, <img>
can see the following examples Picture:

Among them, input, textarea, select, button, img are both inline elements and replacement elements, so the width and height can be set

Replacement elements:

Features:

  • It is also an inline element, but its specific style is determined by the user modifying the style attribute

common:

<input>, <textarea>, <select><option>, <button>, <img>
can see the following example diagram: