Solved

Impossible 3 column CSS Layout?  (Percent, Fixed, Percent) with 100% height

Posted on 2009-05-20
10
618 Views
Last Modified: 2012-08-13
So, i have searched and search and come close but not exact... I am trying to create a 3 column CSS layout - where the left and right column are percentage and the middle column is a fixed pixel sized centered between the two percentage-based left and right columns. ALSO (this is the kicker) I need to have all of the columns adjust vertically to 100% height no matter what amount of content is in each column.  Is this an impossibility?  

Thanks
John
3col2.gif
0
Comment
Question by:OrbitMonkey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
10 Comments
 
LVL 12

Expert Comment

by:alien109
ID: 24432721
0
 
LVL 12

Expert Comment

by:alien109
ID: 24432730
the 100% height isn't there, but I'm sure it can be tweaked.
0
 

Author Comment

by:OrbitMonkey
ID: 24432959
Well, yeah It's the 100% height that is really the issue - I've TRIED tweaking it to no avail.  I guess that's where i need help - with the tweaking part :)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:Thorn007
ID: 24433000
to get the height thing to work you need to specify the bottom position.
* {
margin:0;
padding:0;
}
#wrapper {
bottom:0;
display:block;
position:absolute;
top:0;
width:100%;
}
#left {
left:0;
position:absolute;
right:50%;
top:0;
z-index:5;
}
#left p {
padding-right:300px;
}
#center {
background:#00FF00 none repeat scroll 0 0;
bottom:0;
left:50%;
margin-left:-300px;
position:absolute;
top:0;
width:600px;
z-index:5;
}
#right {
left:50%;
margin:0 auto;
position:absolute;
right:0;
top:0;
z-index:1;
}
#right p {
padding-left:300px;
}

Open in new window

0
 
LVL 4

Expert Comment

by:Thorn007
ID: 24433039
the above are tweaks to alien
0
 

Author Comment

by:OrbitMonkey
ID: 24433105
Thorn007 - That is close!!  The center column is 100% height - but is there a way to have the left and right columns 100% height as well?  

Thanks
John
0
 
LVL 4

Expert Comment

by:Thorn007
ID: 24433113
one sec
0
 
LVL 4

Accepted Solution

by:
Thorn007 earned 500 total points
ID: 24433146

* {
margin:0;
padding:0;
}
#wrapper {
display:block;
position:absolute;
width:100%;
bottom:0;
top:0;
}
#left {
left:0;
position:absolute;
right:50%;
top:0;
z-index:5;
bottom:0;
background:#ccc;
}
#left p {
padding-right:300px;
}
#center {
background:#00FF00 none repeat scroll 0 0;
left:50%;
margin-left:-300px;
position:absolute;
top:0;
width:600px;
z-index:10;
bottom:0;
}
#right {
left:50%;
margin:0 auto;
position:absolute;
right:0;
top:0;
z-index:1;
bottom:0;
background:#00f;
}
#right p {
padding-left:300px;
}

Open in new window

0
 

Author Comment

by:OrbitMonkey
ID: 24433245
You rock!  I pulled many a hair out on something that seems so simple!!!  Thank you, Thank you!  WOOT!
0
 

Author Comment

by:OrbitMonkey
ID: 24433292
I'll mark Thorn's Answer as the correct one - but i'm posting the entire HTML code for future reference in case alien109 link goes away...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Template</title>
<style type="text/css">
 
* {
margin:0;
padding:0;
}
#wrapper {
display:block;
position:absolute;
width:100%;
bottom:0;
top:0;
}
#left {
left:0;
position:absolute;
right:50%;
top:0;
z-index:5;
bottom:0;
background:#ccc;
}
#left p {
padding-right:300px;
}
#center {
background:#00FF00 none repeat scroll 0 0;
left:50%;
margin-left:-300px;
position:absolute;
top:0;
width:600px;
z-index:10;
bottom:0;
}
#right {
left:50%;
margin:0 auto;
position:absolute;
right:0;
top:0;
z-index:1;
bottom:0;
background:#00f;
}
#right p {
padding-left:300px;
}
 
</style>
</head>
<body>
<div id="wrapper"><div id="left"><p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam laoreet tortor ac nunc. Nulla risus nulla, suscipit eget, rhoncus et, nonummy sed, tortor. Aliquam erat volutpat. Etiam consequat imperdiet lorem. Nullam aliquet volutpat wisi. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed dolo&#9733;&#9733;r pede, tempus non, volutpat dignissim, cursus non, mauris. In tristique. Integer blandit, lorem eget tincidunt posuere, quam wisi fermentum elit, quis aliquam ante enim at nibh. Sed faucibus sem et mi. Donec iac&#9733;&#9733;s nulla nec urna. Phasellus ultricies est et urna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. &#9733;&#9733;Etiam laoreet tortor ac nunc. Nulla risus nulla, suscipit eget, rhoncus et, nonummy sed, tortor. Aliquam erat volutpat. Etiam consequat imperdiet lorem. Nullam aliquet volutpat wisi. </p></div>
<div id="center"><p>
 
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam laoreet tortor ac nunc. Nulla risus nulla, suscipit eget, rhoncus et, nonummy sed, tortor. Aliquam erat volutpat. Etiam consequat imperdiet lorem. Nullam aliquet volutpat wisi. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed dolo&#9733;&#9733;r pede, tempus non, volutpat dignissim, cursus non, mauris. In tristique. Integer blandit, lorem eget tincidunt posuere, quam wisi fermentum elit, quis aliquam ante enim at nibh. Sed faucibus sem et mi. Donec iac&#9733;&#9733;s nulla nec urna. Phasellus ultricies est et urna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. &#9733;&#9733;Etiam laoreet tortor ac nunc. Nulla risus nulla, suscipit eget, rhoncus et, nonummy sed, tortor. Aliquam erat volutpat. Etiam consequat imperdiet lorem. Nullam aliquet volutpat wisi. </p></div>
<div id="right"><p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam laoreet tortor ac nunc. Nulla risus nulla, suscipit eget, rhoncus et, nonummy sed, tortor. Aliquam erat volutpat. Etiam consequat imperdiet lorem. Nullam aliquet volutpat wisi. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed dolo&#9733;&#9733;r pede, tempus non, volutpat dignissim, cursus non, mauris. In tristique. Integer blandit, lorem eget tincidunt posuere, quam wisi fermentum elit, quis aliquam ante enim at nibh. Sed faucibus sem et mi. Donec iac&#9733;&#9733;s nulla nec urna. Phasellus ultricies est et urna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. &#9733;&#9733;Etiam laoreet tortor ac nunc. Nulla risus nulla, suscipit eget, rhoncus et, nonummy sed, tortor. Aliquam erat volutpat. Etiam consequat imperdiet lorem. Nullam aliquet volutpat wisi. </p></div></div>
</body>
</html>

Open in new window

0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question