1. The clear attribute cannot be specified for the parent element of the float element.
If the clear attribute is used for the parent element of the float element in Macie, the layout of the surrounding float element will be chaotic. This is a famous bug of Macie. If you do not know it, it will lead a detour.
2. the float element must specify the width attribute.
Many browsers have bugs when displaying float elements with unspecified width. Therefore, regardless of the content of the float element, you must specify the width attribute for it.
In addition, when specifying Elements, try to use EM instead of PX as the unit.
3. the float element cannot specify attributes such as margin and padding.
IE has a bug when displaying float elements with margin and padding specified. Therefore, do not specify the margin and padding attributes for the float element (you can nest a div inside the float element to set the margin and padding attributes ). You can also use the hack method to specify a special value for IE.
4. The sum of Float elements must be less than 100%
If the sum of the float elements width is exactly 100%, some ancient browsers will not be able to display normally. Therefore, make sure that the sum of width is less than 99%.
5. Have you forgotten to write the DTD?
If the display results of different browsers are different, check whether the following line of DTD has been written at the beginning of the page:
<〈! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en" "http://www.w3.org/TR/html4/loose.dtd"> "〉
6. Why is the hover style unavailable after hyperlink access?
The hyperlink style accessed by clicking is not having hover and active, and the solution is to change the order of CSS attributes: L-V-H-A
7. Font: 12px/1.5: 1.5 indicates line-height ). 1.5 indicates 1.5 times of 12px
Em indicates the font height. The default font height of any browser is 16 PX. Therefore, unadjusted browsers all comply with the following requirements:
1em = 16px. Then 12px = 0.75em, 10px = 0.625em.
(1) The EM value is not fixed;
(2) Em inherits the font size of the parent element.