View Full Version : floating trouble
Mzungu
12-19-2003, 04:30 PM
I have made this very simple design consisting of three elements inside a div of fixed size centered horisontally and vertically.
Check it out (http://maarup.net/test/ppk) and explain to me why the two rightmost elements are separated like they are. Obviously I want them to stick together.
Thanks
Mz
Roy Sinclair
12-19-2003, 04:48 PM
That's probably caused by the blank line between the top div and the content div.
adios
12-19-2003, 05:53 PM
More or less...it's actually the white space between the <div> tags and the <img> tags, just like in a table when you break cell markup over two lines.
Why not just do:
#nav{
width:192px;
height:420px;
float:left;
background-image:url(leftbackground.jpg);
}
#title{
width:568px;
height:93px;
float:left;
margin:0;
padding:0;
background-image:url(title.jpg);
}
Mzungu
12-21-2003, 11:09 AM
Thanks
Just to understand this properly, the white space was a regular linebreak caused by the img being the same width as the parent div AND being preceded by a space?
Mz
I think it's caused by the linebreak between the <img> tag and the </div> tag, counted as a space which takes place on a new line.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.