CSS+DIV is one of the commonly used terms in website standards (or "WEB standards"). It is usually used to explain the difference from the table positioning method in the HTML web design language, because in the XHTML website design standards, table positioning is no longer used. technology, but uses css+div to achieve various positioning. It's easy to make some mistakes when applying DIV+CSS coding. This article lists some common mistakes:
1. Check whether there are spelling errors in HTML elements and whether the closing tag is forgotten.
Even experienced users often get the nesting of divs wrong. You can use Dreamweaver's verification function to check for errors. Webjx.Com
2. Check whether the CSS is correct
Check for spelling errors, forgotten } at the end, etc. You can use CleanCSS to check CSS for spelling errors. CleanCSS is a tool to reduce weight for CSS, but it can also check for spelling errors.
3. Determine where the error occurred
If the error affects the overall layout, you can delete the div blocks one by one until the display returns to normal after deleting a certain div block, and you can determine where the error occurred.
4. Use the border attribute to determine the layout characteristics of the error element
Using float attribute layout can cause errors if you are not careful. At this time, add the border attribute to the element to determine the element boundary, and the cause of the error will be revealed.
5. The parent element of a float element cannot specify the clear attribute.
Under MacIE, if you use the clear attribute on the parent element of a float element, the layout of the surrounding float elements will be confused. This is a famous bug of MacIE. If you don't know it, you will take detours.
6. The float element must specify the width attribute Webjx.Com
Many browsers have bugs when displaying float elements with unspecified width. So regardless of the content of the float element, the width attribute must be specified for it.