Jump to content

CSS Layout Help


coast917

Recommended Posts

I'm trying to convert a site from a table layout to a (hopefully) all-CSS layout.

 

Everything is going great up until I reached my current state.

 

This is where it is currently at:

beforege6.jpg

 

This is where I want it to end up:

afterck6.jpg

 

As you can see, I need the main content area, which will always be the longest, to force it's size on the left & right content areas.  The left isn't quite so important since it shares it's background with the rest of the page.  The right side does not though an must stay the same as the center area.

 

The second thing is that I will need two background images that run the length of the main content are (one on the left, and one on the right).  This is show in the "after" picture.

 

I can't seem to get anything that works.  Here is the HTML and CSS code for the "before" layout.

 

<html>
<head>
<title>Title</title>
<link rel=StyleSheet href="layout.css" type="text/css" />
<body>
<div id="container">
<div id="leftColumn">
	<?= $leftContent ;?>
</div>
<div id="mastHead">
	<?= $mastHead; ?>
</div>
<div id="rightColumn">
	<?= $rightContent; ?>
</div>
<div id="content">
	<?= $content; ?>
</div>
<div id="footer">
	<?= $footer; ?>
</div>
</div>
</body>
</html>

 

body {
margin: 0px;
padding: 0px;
fo[i]nt-family: verdana, geneva, arial, helvetica, 'sans-serif';
font-size: 10px;
font-weight: normal;
line-height: 13px;
text-decoration: none;
background: #d5d5b2;
}

#container {
min-width: 800px;
}

#leftColumn {
width: 170px;
float: left;
}

#mastHead {
/*background-image: url("/graphics/mastheads/secmastheadback.gif");*/
margin-left: 170px;
}

#content {
min-width: 550px;
margin-left: 170px;
padding: 0px;
background-color: #fff;
margin-right: 185px;
}



#rightColumn {
width: 152px;
float: right;
background-color: #0f0;
padding: 10px;
background-color: #d6c79f;
margin-right: 12px;
}
[/i]
#footer {
width: 100%;
text-align: center;
}

 

Any ideas?  Thanks!

 

Link to comment
https://forums.phpfreaks.com/topic/60217-css-layout-help/
Share on other sites

This is a losing battle if you have don't have a fixed height for the longest div.

 

You WILL find ways to make it work in real browsers only. Unfortunately, there is no hack in the world that will make it work in IE.

 

Here is a great css master who tried - "equal height boxes part II:

 

http://www.456bereastreet.com/lab/equal_height_ii/

 

 

Link to comment
https://forums.phpfreaks.com/topic/60217-css-layout-help/#findComment-301718
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.