Solution: Add two empty div objects above and below the P object. CSS code: .1{height:0px;overflow:hidden;} or add a border attribute to the DIV.
12. Why is there a gap under the image under IE6? There are many ways to solve this bug. You can change the layout of the html, or set the img to display:block or set the vertical-align attribute to vertical-align:top. | bottom |middle |text-bottom can be solved.
13. How to align text and text input box with vertical-align:middle;
14. There is a difference between id and class defined in web standards What's the difference? 1. Repeating IDs is not allowed in web standards. For example, div id="aa" is not allowed to be repeated twice, and class defines a class, which can theoretically be repeated infinitely, so definitions that need to be referenced multiple times can be Use him. 2. The priority of attributes. The priority of ID is higher than that of class. See Example 3 above. It is convenient for client scripts such as JS. If you want to perform script operations on an object in the page, you can define it for it. An ID, otherwise you can only find it by traversing the page elements and specifying specific attributes. This is a relative waste of time and resources, and is far less simple than an ID.
15. After the content in LI exceeds the length, use an ellipsis Display method This method is applicable to IE and OP browsers
16. Why can’t IE set the scroll bar color in web standards? The solution is to replace the body with html
17. Why can't I define a container with a height of about 1px? This problem under IE6 is caused by the default line height. There are many solutions, such as: overflow: hidden | zoom:0.08 | line-height:1px
18. How to make the layer display on top of FLASH? The solution is to set transparent for FLASH
19. How to vertically center a layer in the browser. Here we use percentage absolute positioning, and the method of patching negative values outside. The size of the negative value is its own width and height divided by two< ;style type="text/css">
FF and IE
1. Div centering problem. The div is already centered when margin-left and margin-right are set to auto. IE No, IE needs to set the body to be centered. First define text-algin: center in the parent element; this means that the content within the parent element is centered.
2. The border and background of the link (a tag). To add a border and background color to the a link, you need to set display: block and float: left to ensure no line breaks. Referring to menubar, setting the height of a and menubar is to avoid dislocation of the bottom edge display. If height is not set, a space can be inserted in menubar.
3. The problem that the hover style does not appear after the hyperlink is visited. The hyperlink style that is clicked and visited no longer has hover and active. Many people should have encountered this problem. The solution is to change the CSS properties. Sorting order: L-V-H-A Code:
The difference in the problem is whether the overall width of the container includes the width of the border. Here IE6 interprets it as 200PX, while FF interprets it as 220PX. So what exactly causes the problem? If you remove the xml at the top of the container, you will find that the original problem lies here. The statement at the top triggers IE's qurks mode. For relevant knowledge about qurks mode and standards mode, please refer to: http://www.microsoft.com/china /msdn/library/webservices/asp.net/ ASPNETusStan.mspx?mfr=true
IE6, IE7, FF IE7.0 is out, and there are new problems with CSS support. There are more browsers, and the compatibility of web pages is getting worse. We are still struggling. In order to solve the compatibility problem of IE7.0, I found the following article: Now I mostly use !important to hack, for ie6 and firefox The test can be displayed normally, but ie7 can correctly interpret !important, which will cause the page not to be displayed as required! The following is a compatibility collection of three browsers.
The first is the CSS HACK method height:20px; /*For Firefox*/ *height:25px; /*For IE7 & IE6*/ _height :20px; /*For IE6*/ Pay attention to the order. This is also a CSS HACK, but it is not as simple as the above. #example { color: #333; } /* Moz */ * html #example { color: #666; } /* IE6 */ * html #example { color: #999; } /* IE7 */
< !--[if lte IE 6]>
The third method is the css filter method. The following is a classic translation from a foreign website. . Create a new css style as follows: #item { width: 200px; height: 200px; background: red; } Create a new div and use the previously defined css style:
some text here< /div> Add the lang attribute here in the body expression, the Chinese is zh: Now define a style for the div element: *:lang(en) #item{ background:green !important; } This is done to overwrite the original css style with !important. Since the :lang selector is not supported by IE7.0, it will not have any effect on this sentence. Therefore, the same effect under IE6.0 is achieved, but it is very difficult. Unfortunately, Safari also does not support this attribute, so you need to add the following CSS style: #item:empty { background: green !important } : The empty selector is a CSS3 specification. Although Safari does not support this specification, it will still be used. Selecting this element, regardless of whether this element exists, will now be green on all browsers except IE. For compatibility with IE6 and FF, you can consider the previous !important. Personally, I prefer to use
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn