neologan
09-09-2009, 02:38 AM
having a bit of trouble trying to get some divs to do what i want them to do, can anyone help me achieve it?
here's an image of the way it is at the moment:
http://img40.imageshack.us/img40/5181/examplediv.gif
In the image, you can see four divs in a container div, all four are set to align: left. These four divs must use the same style (style2), and not seperate styles.
What i want to do is make div 3 nudge up to where div 1 is, and not create a gap by following the end of div 2. I don't know what the correct code is, or if it's even possible to do, but if anyone knows, please help :)
Here's the code for this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {border:1px solid #000000; width:620px; position:relative;
}
.style2 {border:1px solid #000000; width:300px; float:left;}
-->
</style>
</head>
<body>
<div class="style1">
<div class="style2">box 1<br>
<br>
<br>
</div>
<div class="style2">box 2<br>
<br>
<br>
<br>
</div>
<div class="style2">box 3<br>
<br>
</div>
<div class="style2">box 4<br>
<br>
<br>
</div>
</div>
</body>
</html>
and i've attached the html file as well.
here's an image of the way it is at the moment:
http://img40.imageshack.us/img40/5181/examplediv.gif
In the image, you can see four divs in a container div, all four are set to align: left. These four divs must use the same style (style2), and not seperate styles.
What i want to do is make div 3 nudge up to where div 1 is, and not create a gap by following the end of div 2. I don't know what the correct code is, or if it's even possible to do, but if anyone knows, please help :)
Here's the code for this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {border:1px solid #000000; width:620px; position:relative;
}
.style2 {border:1px solid #000000; width:300px; float:left;}
-->
</style>
</head>
<body>
<div class="style1">
<div class="style2">box 1<br>
<br>
<br>
</div>
<div class="style2">box 2<br>
<br>
<br>
<br>
</div>
<div class="style2">box 3<br>
<br>
</div>
<div class="style2">box 4<br>
<br>
<br>
</div>
</div>
</body>
</html>
and i've attached the html file as well.
