The float attribute does not work when the content needs to be automatically changed during Firefox Web page layout.

Source: Internet
Author: User
Use dreamweaver8 to write the following code:

<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> untitled document </title>
<Style type = "text/CSS">
# Left {
Float: left;
Background-color: # 3366ff;
}
# Right {
Float: left;
Background-color: #33 CCCC;
}
</Style>
</Head>
<Body>
<Div id = "Left">
This is the content on the left center.
</Div>
<Div id = "right">
<Div> This is a long piece of content. Note that the relationship between Firefox and IE and the content on the left is different. Here is a long piece of content. Note that the relationship between Firefox and IE and the content on the left is different. Here is a long piece of content. Note that the relationship between Firefox and IE and the content on the left is different. </Div>
</Div>
</Body>
</Html>

To create a layout of left and right columns, an automatic line feed is generated because there are too many content on the right. The layout is correct during Dreamweaver preview and IE browser viewing. However, in Firefox, the layout is up and down. That is, the float: Left attribute here is invalid.

In this case, you can use the hack CSS method to add code to CSS. Note that there is a space behind [xmlns.

/* Perform hack CSS processing for Firefox */
[Xmlns] # right {
Float: none;
Position: relative;
Margin-left: 130px; // The value here uses the width of the left sidebar.
}

The above method is passed in firefox2.0.0.3.

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.