Jul 24, 2008

Div Child Height Same Height As The Father - how to set child height to be the same..

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > HTML, XML etc..

free web hosting

Div Child Height Same Height As The Father - how to set child height to be the same..

mizako
I will try to explain myself as briefly as possible. I want have the next
xhtml squeletone:
CODE

<html>
 <head>
 </head>
 <body>
 <div id="container">
   <div id="header">
     <div id="searchEngine">
       <!-- Search Engine Markup >
     </div>
   </div>
   <div id="header2">
   </div>
   <div id="primarynav">
       <!-- primary nav Markup >
   </div>
   <div id="content">
       <!-- content Markup >
   </div>
 </div>
 </body>
</html>

This is the css code applied to the previous markup:
CODE

#container {
 position: absolute;
 left: 50%;
 width: 770px;
 top: 20px;
 margin-left: -385px;
 background: #cccccc;
}
#primarynav {
 position: relative;
 width: 160px;
 background: #333333;
 margin: 0px;
 padding: 0px;
 float: right;
}
#header2 {
 position: relative;
 background: #999999;
 height: 150px;
 width: 40px;
 float: right;
}
#header {
 position: relative;
 background: #999999;
 height: 150px;
 width: 570px;
 float: left;
 background: url(../images/background.jpg) top left no-repeat;
}
#content {
 position: relative;
 float: left;
 overflow: auto;
 background: #cccccc;
 width: 570px;
 margin: 0px;
 padding: 0px;
}


Right now i am obtaining the next output:
user posted image
But i want to obtain an output in which the primary nav goes until the bottom of the container as shown in the figure:
user posted image
Any idea how can i manage to do that with CSS?
Help is really, really appreciated.

 

 

 


Reply

arboc7
I think I might know you may need to do in your CSS file.


I think you need to do something like this:
CODE

#primarynav {
 height:100%;
}


Please note that this may not be supported by all browsers. You may need to use various workarounds or "filters" which can be found here: http://centricle.com/ref/css/filters/

Hope this helps!!

Reply

mizako
QUOTE(arboc7 @ Sep 5 2005, 10:23 PM)
I think I might know you may need to do in your CSS file.
I think you need to do something like this:
CODE

#primarynav {
 height:100%;
}


Please note that this may not be supported by all browsers. You may need to use various workarounds or "filters" which can be found here: http://centricle.com/ref/css/filters/

Hope this helps!!
*



Thanks! it seems that the next code fixes the problem. However i remember me trying this before without success. Thanks again.
CODE
#container {
...
height: 100%;
...
}

#primarynav {
...
height: 100%;
...
}


 

 

 


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:


Searching Video's for div, child, height, height, father, set, child, height
advertisement



Div Child Height Same Height As The Father - how to set child height to be the same..



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE