Many Changde website construction experts know the use of css abbreviations, because using abbreviations can help reduce the size of your CSS files and make it easier to read. Here is a summary of some css common tips to lay the foundation for website reconstruction.1. Block and inline element comparison <br /> All HTML elements belong to one of block and inline.
You do not need to set the width to set the background color of a block element with the same width as the text.2. One more box hacking method <br /> The reason why there are so many box hacking methods is that IE's understanding of the box before 6 is different from others, and its width must include the width of the border and the space. To make IE5 and other browsers stick together, you can use the CSS method:
The first width is recognized by all browsers, but IE5.x does not recognize the width setting of the second line. Only because there is a blank comment symbol on that line (how stupid parsing!), IE5.x uses 20 min Drop some white space, and other browsers will use the width of 14, because it is the second line, it will cover the first line.3. Minimum page width
}4. IE and Width and Height Questions
IE doesn't recognize min-this definition, but in fact it treats normal width and height as the condition with min. This question is a big problem. Assuming that only the width and height are used, these two values will not change in normal browsers. Assuming that only the min-width and min-height are used, the width and height are not set under IE.5. Different Cases <br /> When using CSS in XHTML, the element names defined in CSS are different case. In order to prevent this fault, I advocate that all definitions and titles should be lowercase.
Class and id values are also case-sensitive in HTML and XHTML. If you must mix case, please carefully acknowledge that your definition of CSS and tags in XHTML are together.6. Revoke element constraints before class and id <br /> When you write to an element to define class or id, you can omit the previous element constraint, because ID is the only one in a page, clas s can be in Repeatedly used on the page. It doesn't make sense to constrain an element.