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.