Forum Moderators: not2easy

Message Too Old, No Replies

Resetting an attribute?

height: auto?

         

benj0323

11:44 pm on Feb 6, 2005 (gmt 0)

10+ Year Member



Let's say I have this in my css

html {
height: 100%;
}

Then I do this:

@media print {

html {
height:?(I want to reset it to default);
}

}

How do I put it back to default like it was without any CSS at all? Do I do height: auto? What exactly does "auto" do.

Thanks a lot for your help.

moltar

11:48 pm on Feb 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



According to W3C Cascading Style Sheets, level 1 Recommendation 5.5.24 'height' [w3.org]

height: auto;

is correct.

auto
tells the browser to give a block the default height. As if no height was defined at all.

createErrorMsg

3:08 am on Feb 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What exactly does "auto" do

It allows the content to dictate the height of the box.

Or if you prefer the complicated version [w3.org]...

If 'height' is 'auto', the height depends on whether the element has any block-level children and whether it has padding or borders:

If it only has inline-level children, the height is the distance between the top of the topmost line box and the bottom of the bottommost line box.
If it has block-level children, the height is the distance between the top border-edge of the topmost block-level child box that doesn't have margins collapsed through it and the bottom border-edge of the bottommost block-level child box that doesn't have margins collapsed through it.

cEM