Re: vw/vh/vm units

On Fri, Jul 10, 2009 at 4:59 PM, Aryeh Gregor<Simetrical+w3c@gmail.com> wrote:
> On Fri, Jul 10, 2009 at 3:51 PM, Tab Atkins Jr.<jackalmage@gmail.com> wrote:
>> <!DOCTYPE html>
>> <html><head>
>> <title>Test</title>
>> <style>
>> body {
>>        margin: 0;
>>        padding: 0;
>>        background: white;
>> }
>>
>> #test {
>>        background: blue;
>>        padding-top: 135.5%;
>> }
>> </style>
>> </head><body>
>> <div id="test"></div>
>> </body></html>
>
> You don't the <html><head>, </head><body>, </body></html> here, BTW.
> HTML 5 is great for brevity.  :)  Actually, this works just as well:
>
> <!DOCTYPE html>
> <title>Test</title>
> <style>
> html {
>    background: white;
> }
> body {
>    margin: 0;
>    padding-top: 100%;
>    background: blue;
> }
> </style>

Heh, reflex.  I started webdesign in XHTML1, though I ditched it for
HTML5 as soon as I could.  I also close my <li>s and <tr>s.  ^_^

Pretty cool that it's doable with <body>.  I don't usually depend on
<body> for anything - too much magic involved in displaying it.
Pretty awesome how minimal the example ends up being, though.

~TJ

Received on Friday, 10 July 2009 22:29:30 UTC