...

View Full Version : Div alignment wrong (validating things)..!



Jamie2993
11-28-2009, 02:32 AM
Hi All,

I was validating my website: Here (http://j-site.001webs.com);

If you check that website you can see the "Home" Div isnt next to the "Last Updated" Div But its below it.

For HTML and CSS check the source (look at the source);

Any Idea's?
Thanks In Advance,

Jamie.

Excavator
11-28-2009, 03:11 AM
Hello Jamie2993,
.content_b will have to be floated to put .content_i beside it. Have a look at a basic 2 column layout here. (http://nopeople.com/CSS/equal_length_columns/index.html)
Another thing to pay attention to is to make sure the widths of .content_b and _i both fit inside 50em wide .content. See how the box model works here. (http://www.w3.org/TR/CSS2/box.html)

These changes might get you started -


* {

padding: 0;
font-family: arial;
}
.content {
width: 50em;
background-color: #900000;
padding-bottom: 5px;
margin: 0 auto;
overflow: auto; /*to clear the floats*/
}
.content_b {
width: 10em;
margin-left: 5px;
margin-right: 5px;
padding-top: 5px;
float: left;
}
.content_i {
width: 38.9em;
background-color: white;
margin-top: 5px;
border: 1px solid black;
padding-bottom: 0.3em;
float: right; /*because it's imposible to margin-left since em and px are both used*/
}

Jamie2993
11-28-2009, 03:14 AM
But float: left;

makes the borders disappear.

Jamie2993
11-28-2009, 03:20 AM
ok ignore that last bit;

i cant get it to go left and right they are currently overlapped :S

Jamie2993
11-28-2009, 03:21 AM
actually i love you :P :cool:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum