UL in Firefox and IE under the different performance of the solution _ Experience Exchange

Source: Internet
Author: User
Recently made a oblog system template, which involves the UL, so I sorted out this article + this big picture.
UL is a very common label, but because of its different performance under the Firefox and IE, people feel that it is a very difficult to control the label.
UL in Firefox has a padding value, but there is no margin value, and in IE, the opposite, UL has a margin value, but no padding value. "The second and third example in the comparison can be seen in the"
Under Firefox, UL's List-style is on the outside edge of the content by default. Of course, the List-style can be set to the inner edge of the content via CSS.
Get the right settings for two browsers by trade-offs: padding:0; margin:0; List-style:inside;. You can also set the UL to padding:0; margin:0; List-style:none, and then add a background image to Li, is also a good choice.
<textarea id="runcode79858"><style type= "Text/css" > body{font-size:12px; margin:20px; line-height:18px;} #box {width:200px; Background-color: #CC9; border: #990 1px solid;} #box ul{padding:0; margin:0; list-style:inside decimal;} </style> <ul> <li> This is the first sentence. </li> <li> This is the second sentence. </li> <li> This is the third sentence. </li> <li> This is the fourth sentence. </li> <li> This is the fifth sentence. </li> </ul></textarea>
[Ctrl + A full selection Note: If you need to introduce external JS need to refresh to execute]
  • 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.