Log in

View Full Version : Me and divs!!



Jackboy
04-05-2008, 06:34 PM
I am having problems with divs.

http://91.111.82.46/DJ/

I basically want the green box slightly under the pink box whenever any box expands.

An experienced coder will realise what i have done wrong ;)

I am naff with divs, this is my first ever attempt at them.

People that fix will be +repped

Excellent
04-05-2008, 06:39 PM
Use containers. Would be much easier. You only have two columns so do a container for the left column, width would be 208 as thats your image width. Then make it float left. And do the same for the other column (center one) but change the width.

--ss--
04-05-2008, 06:43 PM
Err i'm confused on what exactly you want , maybe a screenie of it on how it should look like?

Also no offence but you really need to clean your syntaxing off the coding as it's currently terrible and hard to read :(.

Excellent
04-05-2008, 06:45 PM
Err i'm confused on what exactly you want , maybe a screenie of it on how it should look like?

Also no offence but you really need to clean your syntaxing off the coding as it's currently terrible and hard to read :(.I have to agree with that last bit, your syntax needs a good wash.

Jackboy
04-05-2008, 07:02 PM
Err i'm confused on what exactly you want , maybe a screenie of it on how it should look like?

Also no offence but you really need to clean your syntaxing off the coding as it's currently terrible and hard to read :(.

Agreed i am appauling, but i do php mainly

This is what i want:

http://www.tehupload.com/9432864328.png

--ss--
04-05-2008, 07:18 PM
Agreed i am appauling, but i do php mainly

This is what i want:

http://www.tehupload.com/9432864328.png
For that you will need 3 containers to position your divs in.
The first one is the main container, make the width of this the width of what is going to be inside (The boxes , margins and padding) and have no height attribute, also add the overflow: hidden; code for it's CSS. To center it have it as
margin-left: auto;
margin-right: auto
margin-top: what ever you want.

The second container should be for the 2 smaller boxes that are going to be on the left, Set the width for this as the exact width off the nav box with no height variable. Put a float: left; tag in the CSS aswell.

The 3rd is going to be for the main content box and have the width of it the same as what the boxe's width is. Have it floated to left with the following code; Float: right;

For all of this to work the total width of everything must not exceed the width of the container.
Your coding syntax should look something like this:


<body>
<div id="container">
<div id="left">
<div id="nav">
<div id="nav_top"></div>
<div id="nav_mid"></div>
<div id="nav_bot"></div>
</div>
<div id="login">
<div id="login_top"></div>
<div id="login_mid"></div>
<div id="login_bot"></div>
</div>
</div>
<div id="right">
<div id="main">
<div id="main_top"></div>
<div id="main_mid"></div>
<div id="main_bot"></div>
</div>
</div>
</div>
</body>

I hope I helped as this took forever just to type up on the spot :(.

Jackboy
04-05-2008, 07:55 PM
For that you will need 3 containers to position your divs in.
The first one is the main container, make the width of this the width of what is going to be inside (The boxes , margins and padding) and have no height attribute, also add the overflow: hidden; code for it's CSS. To center it have it as
margin-left: auto;
margin-right: auto
margin-top: what ever you want.

The second container should be for the 2 smaller boxes that are going to be on the left, Set the width for this as the exact width off the nav box with no height variable. Put a float: left; tag in the CSS aswell.

The 3rd is going to be for the main content box and have the width of it the same as what the boxe's width is. Have it floated to left with the following code; Float: right;

For all of this to work the total width of everything must not exceed the width of the container.
Your coding syntax should look something like this:


<body>
<div id="container">
<div id="left">
<div id="nav">
<div id="nav_top"></div>
<div id="nav_mid"></div>
<div id="nav_bot"></div>
</div>
<div id="login">
<div id="login_top"></div>
<div id="login_mid"></div>
<div id="login_bot"></div>
</div>
</div>
<div id="right">
<div id="main">
<div id="main_top"></div>
<div id="main_mid"></div>
<div id="main_bot"></div>
</div>
</div>
</div>
</body>I hope I helped as this took forever just to type up on the spot :(.

Thanks :) Don't i need float left? or summinnn

Want to hide these adverts? Register an account for free!