View Full Version : css and div/span layout.
thesavior
01-24-2006, 12:26 AM
I have tried coding this, with divs and spans, just for it to fall apart. I don't want to use tables, so i think i need someone to code this with div's spans and such. I can change everything, i just need the simple code, so if someone can just code the css and html, i would be quite grateful.
Here is what i want it to look like:
http://www.lonelylizard.com/~eli/files2/4497538.gif
mark87
01-24-2006, 12:34 AM
This should help -
http://bonrouge.com/2c-hf-fluid.php
Ranger56
01-24-2006, 12:37 AM
I have tried coding this, with divs and spans, just for it to fall apart. I don't want to use tables, so i think i need someone to code this with div's spans and such. I can change everything, i just need the simple code, so if someone can just code the css and html, i would be quite grateful.
Here is what i want it to look like:
http://www.lonelylizard.com/~eli/files2/4497538.gif
Try modifying this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
<!--
div#header{
width:100%;
background-color:#ccc;
height:50px;
}
div#leftcol{
width:20%;
background-color:#aaa;
height:auto;
float:left;
}
div#rightcol{
width:80%;
background-color:#fff;
height:auto;
float:left;
}
div#footer{
width:100%;
background-color:#ccc;
height:25px;
clear:both;
}
-->
</style>
<meta http-equiv="Content-type" content="text/html; charset=ISO-8859-1">
<title>Untitled</title>
</head>
<body>
<div id="header">Header</div>
<div id="leftcol">Left Column<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut pretium magna nec arcu. Donec rutrum. Aliquam sit amet elit ac arcu adipiscing aliquam. Aliquam et ipsum at felis molestie congue. Sed eget purus vel turpis semper dignissim. Nullam semper, libero gravida porttitor elementum, dui dolor viverra nibh, at hendrerit enim justo auctor sapien. Vivamus quis risus quis nisi vulputate porttitor. In hac habitasse platea dictumst. Etiam magna odio, malesuada placerat, bibendum sit amet, fringilla id, arcu. Vestibulum porta. Aliquam auctor nisi a nisi.
</p><p>
Aliquam consequat. Vestibulum id augue a libero ornare eleifend. Mauris tellus dui, faucibus ac, mollis quis, rhoncus in, ante. Etiam elementum varius diam. Donec aliquam. Nunc consequat dapibus est. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sed pede et quam vulputate porttitor. Suspendisse venenatis. Curabitur ultrices pede sed diam ultricies sagittis. </p>
</div>
<div id="rightcol">Right Column. leftcol and rightcol expand vertically.
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut pretium magna nec arcu. Donec rutrum. Aliquam sit amet elit ac arcu adipiscing aliquam. Aliquam et ipsum at felis molestie congue. Sed eget purus vel turpis semper dignissim. Nullam semper, libero gravida porttitor elementum, dui dolor viverra nibh, at hendrerit enim justo auctor sapien. Vivamus quis risus quis nisi vulputate porttitor. In hac habitasse platea dictumst. Etiam magna odio, malesuada placerat, bibendum sit amet, fringilla id, arcu. Vestibulum porta. Aliquam auctor nisi a nisi.
</p><p>
Aliquam consequat. Vestibulum id augue a libero ornare eleifend. Mauris tellus dui, faucibus ac, mollis quis, rhoncus in, ante. Etiam elementum varius diam. Donec aliquam. Nunc consequat dapibus est. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sed pede et quam vulputate porttitor. Suspendisse venenatis. Curabitur ultrices pede sed diam ultricies sagittis. </p>
</div>
<div id="footer">Footer</div>
</body>
</html>
thesavior
01-24-2006, 12:45 AM
@mark87:
i have seen that before, but it doesn't work properly as i am putting it inside of another page. It isn't the main page, but it will hold contents im pulling out of a database. Any other ideas?
here is what it looks like with the above codes:
http://www.lonelylizard.com/~eli/test.php
thesavior
01-24-2006, 12:49 AM
@ranger56.
Yours has issues also, it works normally, just not in my page the way i want it to.
Look at yours here:
http://www.lonelylizard.com/~eli/test2.php
Ranger56
01-24-2006, 12:53 AM
@ranger56.
Yours has issues also, it works normally, just not in my page the way i want it to.
Look at yours here:
http://www.lonelylizard.com/~eli/test2.php
you could try putting the leftcol and right col into a div together so they will expand together.
thesavior
01-24-2006, 12:56 AM
no, because one will be an image preview, that has a fixed width, the other will be like a description, that should grow. This is why i was having problems before. :thumbsup:
Ranger56
01-24-2006, 01:00 AM
no, because one will be an image preview, that has a fixed width, the other will be like a description, that should grow. This is why i was having problems before. :thumbsup:
oh, well change leftco, or rightcol to height:somethingpx; width:somethingpx; and change the other to height:auto; width:auto;
thesavior
01-24-2006, 01:04 AM
okay, well that didn't fix my footer problem.
http://www.lonelylizard.com/~eli/test2.php
Ranger56
01-24-2006, 01:07 AM
okay, well that didn't fix my footer problem.
http://www.lonelylizard.com/~eli/test2.php
you c ould put that whole thing in a div that has width:auto;
so the footer will only be as wide as it.
thesavior
01-24-2006, 01:14 AM
yah, i have done that, and it still doesn't change anything.
http://www.lonelylizard.com/~eli/test2.php
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.