Forum Moderators: not2easy
<!--
<!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" xml:lang="en" lang="en">
<head>
<title></title>
<STYLE TYPE="text/css" MEDIA=screen>
<!--
body{
padding: 0;
margin: 0;
}
#topWraper {
width: 800px;
vertical-align: top;
border: 2px solid #000000;
float: left
}
#topLift {
float: left;
margin-left: 20px;
margin-top: 10px;
border: 2px solid #000000
}
#topMid {
float: left;
margin-left: 200px;
margin-top: 10px;
border: 2px solid #000000;
}
#topRight {
float: left;
margin-left: 200px;
margin-top: 10px;
border: 2px solid #000000;
}
-->
</STYLE>
</head>
<body BGCOLOR="#CCE7FF" >
<div id="topWraper" >
<div id="topLift"><img src="images/cam_bgBlue.gif" width="200" height="118" /></div>
<div di="topMid" ><img src="images/Camera-2.gif" width="200" height="119" /></div>
<div id="topRight"><img src="images/Camera.gif" width="200" height="119" /></div>
</div>
</body>
</html>
-->
[edited by: createErrorMsg at 8:40 pm (utc) on Sep. 21, 2005]
[edit reason] No urls, please. See forum charter. [/edit]
Looks like there are two things in your code that stand between you and the layout you want.
First is this...
<div di="topMid" >
That typo is preventing the styles from being applied to the #topMid div.
Second, you've applied a 200px left margin to the #topMid and #topRight divs, which ismaking them too wide to fit within the container in a single row. Change those 200px margins to 20px and it should work the way you want.
cEM
<!--
<!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" xml:lang="en" lang="en">
<head>
<title></title>
<META NAME="Generator" CONTENT="Stone's WebWriter 3.5">
<STYLE TYPE="text/css" MEDIA=screen>
<!--
body{
padding: 0;
margin: 0;
}
#topWraper {
width: 800px;
vertical-align: top;
border: 2px solid #000000;
float: left
}
#topLift {
float: left;
margin-left: 20px;
margin-top: 10px;
border: 2px solid #000000
}
#Mid {
float: left;
margin-left: 20px;
margin-top: 10px;
border: 2px solid #000000;
}
#topRight {
float: left;
margin-left: 20px;
margin-top: 10px;
border: 2px solid #000000;
}
-->
</STYLE>
</head>
<body BGCOLOR="#CCE7FF" >
<div id="topWraper" >
<div id="topLift"><img src="images/cam_bgBlue.gif" width="200" height="118" /></div>
<div div="Mid" ><img src="images/Camera-2.gif" width="200" height="119" /></div>
<div id="topRight"><img src="images/Camera.gif" width="200" height="119" /></div>
</div>
</body>
</html>
[edited by: createErrorMsg at 10:57 pm (utc) on Sep. 21, 2005]
[edit reason] no urls, please. See forum charter. [/edit]
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<META NAME="Generator" CONTENT="Microsoft FrontPage 5.0">
<STYLE TYPE="text/css" MEDIA=screen>
<!--
body{
padding: 0;
margin: 0;
}
#topWrapper {
width: 800px;
vertical-align: top;
border: 2px solid #000000;
float: left
}
#topLeft {
float: left;
margin-left: 20px;
margin-top: 10px;
border: 2px solid #000000
}
#topMid {
float: left;
margin-left: 20px;
margin-top: 10px;
border: 2px solid #000000;
}
#topRight {
float: left;
margin-left: 20px;
margin-top: 10px;
border: 2px solid #000000;
}
-->
</STYLE>
</head>
<body BGCOLOR="#CCE7FF" >
<div id="topWrapper" >
<div id="topLeft"><img src="images/cam_bgBlue.gif" width="200" height="118" /></div>
<div id="topMid" ><img src="images/Camera-2.gif" width="200" height="119" /></div>
<div id="topRight"><img src="images/Camera.gif" width="200" height="119" /></div>
</div>
</body>
</html>
cEM once I make a correction my div it worked in Internet Explorer, Firefox, Netscape 6, and Opera 7. So I am curious as to one the width attribute is necessary unassuming you're talking about the HTML and not the CSS rule.
With the div containing nothing but a 200px wide image, the divs without an explicit width are likely to work just fine. However, the specs specifically state that floated elements are to have an explicit width. Furthermore, doing so removes the potential for creating a scenario where the browser is uncertain how to calculate a width for the float, ending in inconsistent results.
You could almost certainly live without giving the divs a width, however, there's no harm in adding them in, and some potential benefit in doing so.
Rule of thumb: always give floated elements a width, in the CSS, using the width property (not using an attribute in the html tag).
cEM