I. Introduction HTML elements
HTML documents are defined by HTML elements, HTML element refers to all the code from the start tag (start tag) to the end tag (end tag) is.
Start tag is often referred to a start tag (opening tag), often referred to as closed end tag label (closing tag).
Two, HTML element syntax
Element start tag 1.HTML to start, the termination end-tag, for example: <p> This is a paragraph </ p>, note that "/."
2. The content of element content between the start and end tags, for example: <p> This is what </ p>.
3. No content of tags are called empty elements, an empty element is closed at the beginning of the label, for example: a, which is a newline tag.
4. Most HTML elements can have attributes, and then explained in detail after this property.
Three, HTML elements classification
1. The block-level elements: block-level element refers to the property itself is a display: block; element, because of its own characteristics, we usually use large block-level layout element to build large structures.
2. inline element (inline elements): inline elements refers to itself as a property display: inline; element, because its own characteristics, we usually set up to carry out the text, small icons, small structures using inline elements.
Four difference, block-level element and the inner element row
Block-level elements | Row element |
Own property display: block; | Own property display: inline; |
An exclusive line, a block element each on a new line will start again, arranged from top to bottom | And other inline elements left to right in a row |
Can directly control the width, height and other attributes related css, e.g. (padding series, series margin) | You can not directly control the width, height and other attributes related css, but may be provided inside and outside the left and right margin values directly. |
In the case where the width is not provided, the width of the block elements is the width of its parent element content | Width and height inline elements is determined by the size of the content itself (text, images, etc.). |
In the case where the height is not provided, the height is the height of block-level elements of its own content | Inline elements can receive text or other inline elements, not nested block-level elements |
Five commonly used HTML elements
Tags are not case sensitive, but it is recommended to use lower case, (X) HTML version of the mandatory use of lowercase, so more rigorous
Block-level elements | description | Row element | description |
div | Common block-level container | span | Common elements of the row, text block within the definition of |
h1 ~ h6 | Main title, subtitle two, three subtitle ..... | a | Anchor, hyperlinks |
hr | Horizontal dividing line | b | Bold text |
menu | Menu List | strong | Emphasized text in bold |
ol | Ordered list | i | Text in italics |
the | Unordered list | in | Emphasized text in italics |
at the | List items | br | Force a line break |
dl | Definition list | input | Text entry box |
table | form | textarea | Multi-line text input box |
p | paragraph | img | Introducing pictures |
form | Interactive form | select | drop-down list |
2019.06.27 22:11
Tomorrow tasks:
1. write HTML code for common errors and how to fix?
2. <head> </ head> you can put what, what role?
3. New Page, practice HTML elements.