Forum : height and width property
Brief description  about Online courses   join in Online courses
View Alka  Purwar 's Profile

height and width property

why do one uses min/max property. as take an example if we need to write a paragraph of arround 15 lines, and we have defined 20px max height, than whole page become blurred means words will be overwritten(or if we have declare min height more and the paragraph length is less;than it also be waste of space). so here question comes that what is the point of declairing max/min height? and if you knew the length of paragraph already than only you should declare it otherwise not. can you give more light to this query..


even at times i think that question looks absurd; but still i m confused abt it-:)..


Regards
Asked by Alka Purwar | Aug 21, 2009 |  Reply now
Replies (2)
View alka purwar 's Profile
Thanks Navneet

but what i feel is that using min/max height/width property is like wasting of space at most of the times. As you mentioned in your example that if the text is of only 2 lines and min height is 300 px than the rest space is wasted..so its better to nt to use this property because of this drawback.

i think there will be some points,which we need to consider while using these properties..i wish that the teacher will give it to more light.

Regards
Aug 22, 2009
View navneet khanna 's Profile
Hi Alka

Thats good question, I also had the same doubt.
I think the max/min property is used for page decoration purpose.

For example: if the min-height is 300 pixels and the text is written in just 2 lines and the background-color is set as red. Then the user would see the page with 2 lines of text and background color set as red for 300 pixels. The page looks good when the user views it.
Apart from this, sometimes we need to align the middle page with the left and right side of the page, even if the lines of text is less in middle page.

Same is the case with max-height also. Sometimes we do not want the red background to be filled till 300 pixels.
For example: If you have 30 lines of text and max-height is 20 pixel with background color of red. In this case the red color would not be visible behind all the text. It will be visible only for 20 pixels height, which may be sometimes required for good look.

I hope it answers your question.

Regards
Aug 21, 2009