CSS browser compatibility problem set (2)

Source: Internet
Author: User

11. highly unsuitable

Height mismatch means that the height of the outer layer cannot be automatically adjusted when the height of the inner layer object changes, especially when the inner layer object uses margin or paddign.
Example:
# Box {background-color: # eee ;}
# Box p {margin-top: 20px; margin-bottom: 20px; text-align: center ;}

Content in object p



Solution: Add two empty div objects to the upper and lower sides of the P object. CSS code:. 1 {height: 0px; overflow: hidden;} or add the border attribute to the DIV.

12. Why is there a gap in the image under IE6?

There are also many ways to solve this BUG. You can change the html layout, set img to display: block, or set vertical-align to vertical-align: top | bottom | middle | both text and bottom can be solved.

13. Align text and text input boxes

Add vertical-align: middle;


14. What is the difference between id and class defined in web standards?

I. duplicate IDs are not allowed in web standards. For example, div ID = "aa" cannot be repeated twice, while class defines classes, which can be infinitely repeated in theory, in this way, you can use the definition that requires multiple references.

Ii. attribute priority
The priority of ID is higher than that of class.

III. convenience for JS and other client scripts. If you want to perform script operations on an object on the page, you can define an ID for it. Otherwise, you can only find it by traversing the page element and adding specific attributes, this is a relatively time-consuming resource, which is far less simple than an ID.

15. How to display the content in LI with ellipsis after the content length exceeds

This method is applicable to IE and opbrowser.



16. Why can't I set the color of the scroll bar in web Standard IE?

The solution is to change the body to html.




17. Why cannot I define a container with a height of around 1 px?

In IE6, this problem is caused by the default Row height, and there are many solutions, such as overflow: hidden | zoom: 0.08 | line-height: 1px.

18. How can I display layers on FLASH?

The solution is to make FLASH transparent.


19. How to center a layer vertically in the browser

Here we use the absolute percentage position, and the method of negative value of the external patch, the negative value is its own width and height divided by two

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.