HTML Study Notes (6) and html Study Notes
1. Declare the user's encoding language as follows:
<Metahttp-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
When Chinese characters are garbled on our webpage, we can try to change the value of charset: GBK, gb2312, UTF-8.
2. Write All tags in lowercase letters
Most websites on the market use the xhtml language, and the latest html language is html5. what we started learning in the book is html4. The keyword tags of both xhtml and html5 are in lower case. Therefore, when writing code, all tags must be in lower case.
3. Add the alt attribute to the image
When the image cannot be correctly displayed on the webpage, the alt attribute value can be used to display the image on the webpage.
4. Quote all attribute values
5. Close all labels
Whether it is a single tag or a dual tag, there should be a closed symbol
6. Differences between the Id selector and the class selector:
The id value of the same name can only appear once in the current xhtml, and the class name can be used multiple times.
7. The content of block-level elements will automatically change to a new line.
8. We can use display: block to change an element in a row into a block-level element. We can also use display: inline to change a block-level element into a row element.
9. Floating property of div:
Because the div tag is a block-level element and occupies one row by default, we need to use the floating attribute float to make two or more divs share the same row.
10. You can use margin: 0px auto to set div center in the style;
11. Remove the symbols before the unordered list and Use list-style: none;