Jump to content

Can I Set The Minimum Height Of An Element Using A Percent Value?


Phillip Bromley

Recommended Posts

On the CSS Dimension Properties page on W3Schools's CSS tutorial, I shows how to use CSS to set the height and width of elements.Also on this page it is mentioned how to set the minimum height using a pixel value, it it possible to do this with a percent value instead?In the "set the minimum height of an element using a pixel value" example in the TryIt Editor...http://www.w3schools.com/CSS/tryit.asp?fil..._dim_min-heightIt uses the following code:<html><head><style type="text/css">p{min-height: 100px}</style></head><body><p>This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.</p><img src="logocss.gif" width="95" height="84" /></body></html>I changed it to this:<html><head><style type="text/css">p{min-height: 88.75%}</style></head><body><p>This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.This is some text. This is some text. This is some text.</p><img src="logocss.gif" width="95" height="84" /></body></html>And it failed to adjust the minimum height accordingly. I also tried adding a semicolon ( ; ) to the end, it still didn't work.Is there any way I can set the minimum height with a percent value? If not, will this be possible with HTML 5.0?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...