PDA

View Full Version : Float error, please help!


krifer
05-21-2012, 09:49 PM
I'm not very familiar with css at all so I'm not sure what I'm looking for but I've been playing around with the float, clear, margins, everything and nothing seems to work. Nothing is lining up, everything is bumping down to the next line when its viewed in a browser but looks fine in Dreamweaver.
The code is as follows:

<!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">
<!--
#body {
background-color: #099;
clear: both;
height: 750px;
width: 1000px;
position: relative;
overflow: hidden;
left: auto;
top: auto;
right: auto;
bottom: auto;
margin: auto;
}
#4 {
float: left;
height: 36px;
width: 45px;
}
#1 {
float: left;
height: 46px;
width: 1000px;
}
#5 {
float: left;
height: 36px;
width: 49px;
}
#2 {
float: left;
height: 36px;
width: 873px;
}
#6 {
float: left;
height: 88px;
width: 1000px;
}
#7 {
float: left;
height: 35px;
width: 59px;
}
#8 {
float: left;
height: 33px;
width: 171px;
}
#9 {
float: left;
height: 35px;
width: 175px;
}
#3 {
float: left;
height: 36px;
width: 33px;
}
#10 {
float: left;
height: 35px;
width: 181px;
}
#11 {
float: left;
height: 35px;
width: 175px;
}
#12 {
float: left;
height: 35px;
width: 180px;
}
#13 {
float: left;
height: 35px;
width: 59px;
}
#14 {
float: left;
height: 495px;
width: 1000px;
}
-->
</style>
</head>

<body>
<div id="body">
<div id="1"><img src="images/index_01.jpg" width="1000" height="46" /></div>
<div id="2"><img src="images/index_02.jpg" width="873" height="36" /></div>
<div id="3"><img src="images/index_03.jpg" width="33" height="36" /></div>
<div id="4"><img src="images/index_04.jpg" width="45" height="36" /></div>
<div id="5"><img src="images/index_05.jpg" width="49" height="36" /></div>
<div id="6"><img src="images/index_06.jpg" width="1000" height="88" /></div>
<div id="7"><img src="images/index_07.jpg" width="59" height="35" /></div>
<div id="8"><img src="images/index_08_roll_08.jpg" width="171" height="35" /></div>
<div id="9"><img src="images/index_09.jpg" width="175" height="35" /></div>
<div id="10"><img src="images/index_10.jpg" width="181" height="35" /></div>
<div id="11"><img src="images/index_11.jpg" width="176" height="35" /></div>
<div id="12"><img src="images/index_12.jpg" width="179" height="35" /></div>
<div id="13"><img src="images/index_13.jpg" width="59" height="35" /></div>
<div id="14"><img src="images/index_14.jpg" width="1000" height="495" /></div>
</div>
</body>
</html>

gentleone
05-22-2012, 12:41 AM
ID's or classes can't be only numbers or starting with a number. They get ignored by browsers. Give them proper names and ending with numbers is fine.

krifer
05-22-2012, 01:10 AM
ID's or classes can't be only numbers or starting with a number. They get ignored by browsers. Give them proper names and ending with numbers is fine.



Wow that was such a silly mistake on my part! Thanks so much!

gentleone
05-23-2012, 01:35 PM
Wow that was such a silly mistake on my part! Thanks so much!
You're welcome and we all learn by making mistakes. ;)