Differences between ul labels in Firefox and IE

Source: Internet
Author: User

Ul labels are often used by us, but since I am used to using IE, I do not care about the effect of running it in other browsers, after Firefox is recommended by others, ul is not compatible with IE and Firefox. ul has a padding value in Firefox, but not in IE, on the contrary, there is a margin value in IE, but it does not exist in Firefox. We can use the following example to confirm it.

 

<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<Meta name = "Generator" CONTENT = "EditPlus">
<Meta name = "Author" CONTENT = "">
<Meta name = "Keywords" CONTENT = "">
<Meta name = "Description" CONTENT = "">
<Style type = "text/css">
Body {
Font-size: 12px;
Margin: 20px;
Line-height: 18px;
}
# Box {
Width: 200px;
Background: gray;
Border: white 1px solid;
}
# Box ul {
Padding: 0;
Margin: 0;
List-style: none;
}
</Style>
</HEAD>

<BODY>
<Div id = "box">
<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>
</Div>
</BODY>
</HTML>

 

The above code runs in Firefox and IE. To see their differences, you can set the style # box ul {padding: 0; margin: 0; list-style: none ;} the padding and margin in are called for testing respectively. The code is not pasted here. You can modify the code to understand their differences. Note that ul's list-style in Firefox is at the outer edge by default. You can use CSS to change this style (list-style: inside) to ensure IE compatibility. (This is my personal understanding. please correct me if you have any mistakes ).

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.