Sunday, March 11, 2012

TabContainer/tabpanel

In CSS, when you assign a height to something like a <div> - it's factored in relation to it's parent element.

What you may be finding is that div.tabpanel {height: 100%;} is actually just using "auto" to be as high as it needs to be.

To make it work, you need to define the height of the parent element (probably the body): body {height: 100%;}

You should now be able to apply this CSS behaviour to your tab-panel.


can u show me an example of CSS for div tag?


Sure - Here is the CSS bit:

<style type="text/css">
body {
height:100%;
}
#hundredhigh {
padding:5px;
width:200px;
height:100%; /* works only if parent container is assigned a height value */
background-color: #cccccc;
}
</style>

And here is the html bit to show it working:

<body>
<div id="hundredhigh">
<p>You have to set the body height to 100% before the height will work on "child" elements, like this DIV tag.</p>
</div>
</body>

No comments:

Post a Comment