1. Declare the user's encoding language as follows:
<metahttp-equiv= "Content-type" content= "Text/html;charset=utf-8"/>
When our webpage appears garbled in Chinese, we can try to change the value of CharSet: GBK, gb2312, Utf-8.
2. Write all the labels in lowercase letters
Most of the websites in the market are in the XHTML language, the latest HTML language is HTML5, and what we started to learn is HTML4. Both XHTML and HTML5 keyword tags are lowercase, so when writing code, the labels are all lowercase.
3. Add alt attribute to picture
ALT attribute values can be substituted for images displayed on a Web page when the picture is not displayed correctly on the page.
4. Add quotation marks to all attribute values
5. Close all labels
Both single-label and double-label should have a close symbol
6. The difference between the ID selector and the class selector:
The ID value of the same name is allowed only once in the current XHTML, and the class name can be reused multiple times.
7. The contents of a block-level element are automatically replaced by a new line.
8. We can use display:block; change an inline element into a block-level element; We can also use display:inline; change a block-level element into an inline element.
9. The floating properties of the DIV:
Because the div tag is a block-level element, the default is to occupy a row, then we want to have two or more div on the same line, we will use float property float.
10. In the style Set Div Center can use margin:0px auto;
11. Remove the symbols in front of the unordered list using List-style:none;
HTML Learning Notes (vi)