CSS compatibility processing (ii)

Source: Internet
Author: User

    • Define a small height in IE6 and in the following versions of the browser:

Solution: #text {overflow:hidden; height:1px; font-size:0; line-height:0;}

Detailed explanation: IE6 and the following browsers cannot define a small height because of the default row height.

    • Define the minimum height in IE6 and the following versions of the browser:

Workaround: #text {min-height:100px; _height:100px;}

Note: #text cannot set overflow to hidden at this time, otherwise the analog min-height fails.

    • Resolve the buttons on both sides of the whitening:

Workaround: Input,button {overflow:visible;}

    • Li two floating above appears blank:

Workaround: li {vertical-align:top}

In addition to top, you can set Text-top, middle, bottom, text-bottom, and even specific widths and lengths.

    • Pseudo-element not recognized under IE6: First-letter/:first-line problem:

Workaround:

Method One: Add a space before the curly braces.

Such as:

p:first-letter {float:left; font-size:40px; font-weight:bold;}

p:first-line {color: #090;}

Method Two: Wrap the curly braces before wrapping.

Such as:

P:first-letter

{float:left; font-size:40px;font-weight:bold;}

P:first-line

{color: #090;}

    • Pseudo elements in IE8: First-letter/:first-line ignored! Important rules:

Workaround: Try not to use!important in: First-letter/:first-line.

    • Ignore the same style in IE6! Important rules:

Workaround: Divide the same style by two rules to define the same style.

    • The li inner element defines the bottom of the inline element of the display:block to produce a blank:

Workaround: Add an zoom:1 to the Li inline element.

code example:

Bug Recurrence:

A,span {display:block;background: #ddd;}

<ul>

<li><a href= "..." > Common manuals </a></li>

<li><a href= "..." > Common manuals </a></li>

<li><a href= "..." > Common manuals </a></li>

<li><span> Test Li Internal element defines the Display:block inline element at the bottom of the resulting blank </span></li>

</ul>

Detailed explanation: This bug appears in IE6 and the following version of the browser.

    • Floating or absolute positioning without a defined width is set internally by Zoom:1:

Workaround:

Method One: Set ul as floating element

Method Two: Set ul as inline element

Method Three: Set the width of the UL

code example:

Bug Recurrence:

#test {zoom:1; Overflow:hidden; border:1px solid #ddd; Background: #eee; }

#test h1 {float:left;}

#test. Nav {float:right; background: #aaa;}

#test. Nav ul {zoom:1; overflow:hidden;margin:0; padding:0;list-style:none;}

#test. Nav li {float:left;margin:0 5px;}

<div id= "Test" >

<div class= "NAV" >

<ul>

<li><a href= "..." > Common manuals </a></li>

<li><a href= "..." > Common manuals </a></li>

<li><a href= "..." > Common manuals </a></li>

</ul>

</div>

</div>

Details: such as the above code, IE6 and the following version of the browser Div,nav will be zoom:1 ul.

    • Relative positioning when the parent element overflow property is Auto/hiddle, it fails:

Workaround: Set a relative positioning for the div as well.

Related code:

div {overflow:auto; width:260px; height:80px; border:1px solid #ddd;}

p {position:relative; margin:0;}

<div>

<p>123456</p>

<p>123456</p>

</div>

Detailed explanation: If the above code, under IE7 and earlier browser you will see the scroll bar will not work. Add a relative positioning on the P tab.

    • When applying transition in Google Chrome, the page flashes:

Solution:-webkit-transform-style:preserve-3d; or-webkit-backface-visibility:hidden;

CSS compatibility processing (ii)

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.