Here are some common error-handling techniques for designing Web pages in Div, hoping to help.
1. Check the HTML elements for spelling errors, forgetting to end tags
Even veterans often mistake div for nesting relationships. You can use the Dreamweaver verification function to check for errors.
2. Check that the CSS is correct
Check to see if there are any spelling errors, forgetting the end of the}, and so on. You can use CLEANCSS to check your CSS for spelling errors. CLEANCSS is a tool for CSS to lose weight, but can also check out spelling mistakes.
3. Determine where the error occurred
If the error affects the overall layout, you can delete the div block individually until a div block is removed and the display returns to normal to determine where the error occurred.
4. Using the Border property to determine the layout characteristics of an error element
Using the Float property layout accidentally makes an error. Adding the border attribute to the element determines the bounds of the element, and the reason for the error is the bottom line.
5. The parent element of a FLOAT element cannot specify a clear property
Macie If the clear attribute is used for the parent element of a float, the layout of the float element around is confusing. This is Macie's famous bug, if you do not know it will be detours.
6. Note The float element must specify the Width property
Many browsers have bugs when displaying float elements that do not specify a width. So regardless of the contents of the float element, be sure to specify the width attribute.
Use EM instead of PX as a unit when specifying elements.
7. Note that float elements cannot specify properties such as margin and padding
IE has a bug when displaying float elements that specify margin and padding. Therefore, do not specify the margin and padding properties for float elements (you can set up margin and padding by nesting a div inside a float element). You can also use the Hack method to specify an extraordinary value for IE.
8. Make sure the sum of the width of float element is less than 100%
If the width of the float element is exactly 100%, some old browsers will not display properly. Make sure the sum of width is less than 99%.
9. Check to see if the default style is reset
Some properties such as margin, padding, and so on, different browsers will have different interpretations. Therefore, it is best to first of all margin, padding set to 0, list style set to none, etc.
10. Check if you forgot to write the DTD
If no matter how to adjust different browser display results or not, then you can check the beginning of the page is not forget to write the following line DTD:
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "HTTP://WWW.W3.ORG/TR/HTML4/LOOSE.DTD" >