We have been talking about the optimization of CSS page layout code, and in previous articles, the semantic and the structure of the document have been emphasized. With the promotion of web standards abroad, some novice think, web2.0 is the previous table layout is changed to Div+css layout is web2.0. In fact, we should use these labels rationally. One thing that is noteworthy is the abuse of DIV elements that are commonly referred to as "Div-itis" in the Web Developer's circle.
It is really convenient to add styles through a large number of nested div or span elements, but you should try to avoid this temptation. In most cases, additional styles or JavaScript functionality for existing elements within a document can be done without having to introduce div or span elements. The div or span element as a generic container should be used as a last resort-that is, it is best to write the Web page as semantically as possible, and to join the generic container element only when it is really needed.
so we're going to: optimize and optimize and optimize and streamline and optimize CSS page layout code
I want to use some more semantic tags, but also to the same, tag semantics to use the right.
semantic categories of HTML elements
structure
The semantics of these elements define the roles of the structures they play in the document
Div
span
OL,UL,LI,DL,DT,DD
Del,ins
H1. H6
P
content
The semantics of these elements define the semantics of representing content tags in the document
a
abbr
acronym
Address
blockquote
cite
Code
DFN
KBD
Q
Samp
var
modifier describes
These elements play a part in the modification and description of the content
Strong
em
"Once You" VE completed your markup, go over it two more times and finds ways to reduce the number of elements on the Page. Does that UL really need its own wrapping div? I am not. "
pay attention to your style sheet
when we do a lot of content on our web page, the code for the stylesheet file is huge and bloated.
We also slowly feel that some places are unreasonable or repetitive.
This is your problem with CSS selector application, flexible use of these CSS selectors is the use of CSS to control the basis of the Web page, CSS selector is also the focus of CSS learning and difficult.
should we apply these CSS selectors properly at the beginning of the design?
on the classification of CSS selectors, use, definition, because the content of the greater I do not say, some of the optimization of CSS style sheet to learn about the skills of the article
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.