So, I’ve tried making the making the content area on a page adjust to the height of the content. I tried using the height property and setting it to 100% but it just messes up the page. I can only get the page to work if I use a set px height.
I don’t think its that bad. A lot of those error messages are related to code generated by wordpress. Well, if anyone is capable of helping then just let me know.
So, I’ve tried making the making the content area on a page adjust to the height of the content.
this happens by default. what is it that you really want to happen?
I tried using the height property and setting it to 100% but it just messes up the page.
Setting the height to 100% sets that element to the height of the PARENT element IF (and only if) that parent element has a set height. Also remember that 100% height will overflow or cause scroll bars if you ad vertical padding or margins on top of the 100% height.
In short, you need to declare a fix height somewhere , before you use %
So, what I do want is the #BelowHeaders section to adjust according to the content within it.
So, I set the #MainContent height to 4000px which is what I had it at originally, but the problem is that I have too much blank space at that height. I need more height on some pages vs others. However, I’d just like it to adjust according to the content in the #MainContent area which is most likely dictated by the content in the
what you want (technically) really cant be accomplished with divs/css. It’s not the way they work.
Now, what you want aestetically9 unless my understanding is off is EQUAL HEIGHT COLUMNS ( tongs of tutorials on that out there ) Basically there are TWO WAYS.
First we get rid of those height declarations, as i said before that not the way DIVs and CSS work.
then you create a SMALL bg graphic which you will assign to the container of both your divs, and repeat vertically. That really is the easiest way.
Another technique involves creating separate wrapping shells ( wrapped around ll your content) for each BG change as such:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
.mainCont{background: #555; overflow:hidden;padding-right:250px;}
.inner{ background:pink; width:100%;}
.left , .inner{float:left; width:100%;}
.right{float: right; width:250px; margin-right: -250px; }
</style>
</head>
<body>
<div class="mainCont">
<div class="inner">
<div class="left">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
<div class="right">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. lore </div>
</div>
</div>
</body>
</html>
That’s the natural behvior of an element—to be just as tall as the content. The best option here is to use the faux column method to make it appear that the column is full height.
#MainContent {
background-color:#fff;
[COLOR="#FF0000"]background-image:url("../images/rightnav-bg.png"); /* you may have to adjust the path */
background-repeat:repeat-y;
background-position:right 0;[/COLOR]
width:1024px;
overflow:hidden;
margin:0 auto;
}