Web page Production WEBJX article introduction: 9. Height is not suitable for height is not suitable for when the height of the inner object changes when the outer height can not be automatically adjusted, especially when the inner layer object using margin or paddign. Example: #box {background-color: #eee;} #box content resolution techniques in P {margin-top:20px;margin-bottom:20px; Text-align:center} P objects: in P |
9. Height not suitable
Height is not adaptable when the height of the inner object changes when the outer height is not automatically adjusted, especially when the inner object uses margin or paddign.
Cases:
#box {background-color: #eee;}
#box p {margin-top:20px;margin-bottom:20px; text-align:center;}
Content in the P object
Workaround: Add 2 empty div objects to the P object CSS code:. 1{height:0px;overflow:hidden;} Or add the border attribute to the Div.
10. IE6 Why there is a gap under the picture
There are a number of techniques to solve this bug, either by changing the layout of the HTML, or by setting IMG to Display:block or setting the Vertical-align attribute to Vertical-align:top
Bottom middle text-bottom can be solved.
11. How to align text with an input box
Plus vertical-align:middle;
What is the difference between defining ID and class in the 12.web standard?
A. Web standards are not allowed to duplicate IDs, such as Div id= "AA" does not allow repeat 2 times, and class definition is a class, theoretically can be infinitely repetitive, so need to refer to the definition of multiple references can use him.
Two. Priority issues for attributes
ID priority is higher than class, look at the example above
Three. Convenient JS and other client-side script, if you want to script an object on the page, you can define an ID, otherwise only the use of traversal page elements plus the specified specific attributes to find it, this is a relatively waste of time resources, far less than a simple ID.
Source: Web Front Wind
Responsible Editor: Bluehearts