What's This For?

What’s the purpose of the asterisk before the ‘html body’ in the
SBMH? Couldn’t the tag just be ‘body’; no asterisk?

Todd

   body {
      font-size: small;
      }
   * html body {
      font-size: x-small; /* for IE5/Win */
      font-size: small; /* for other IE versions */
      }

dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

It’s a trick. It fools IE into accepting the rule, when no other
browser on earth would touch it with a barge pole.

Walter

On Nov 2, 2007, at 12:00 PM, Todd wrote:

What’s the purpose of the asterisk before the ‘html body’ in the
SBMH? Couldn’t the tag just be ‘body’; no asterisk?

Todd

   body {
    font-size: small;
    }
   * html body {
    font-size: x-small; /* for IE5/Win */
    font-size: small; /* for other IE versions */
    }

dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi,
Some precisions:
The * is called the universal selector as it acts like a wildcard, matching all the available elements.
Ex. of use:

* {
   margin: 0;
   padding: 0;
}

This code set all margins/padding to zero.

Used with html, it’s a hack named The Star HTML hack.
It targets an HTML element enclosed inside another element.
This only happens in IE 6 (and below) as these browsers have an anonymous root element wrapping around the HTML element (thanks M. Microsoft).
(mainly from CSS Mastery written by Andy BUDD).


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Ho la la,
Sorry the BBCode tags.
The CSS is

  • {
    margin: 0;
    padding: 0;
    }

On Nov 2, 2007, at 1:28 PM, JJBee wrote:

Ho la la,
Sorry the BBCode tags.
The CSS is

  • {
    margin: 0;
    padding: 0;
    }

This is a very useful bit of code, used to reset everything that a
browser might do by default back to “known base” values. Then you
build up from there, adding padding and margins to elements that you
want to style. This keeps the page looking the way you expect in as
many browsers as possible.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi,
I’ve found this at the Andrew Krespanis blog.
Beside that, it seems like BBCode tags work so sorry for my useless previous post.


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

So for example in my IE5 stylesheet could I add the below CSS then go
back through and add the proper margins and paddings to each element
and/or style. Am I understanding that correctly?

Todd

On Nov 2, 2007, at 12:53 PM, Walter Lee Davis wrote:

On Nov 2, 2007, at 1:28 PM, JJBee wrote:

Ho la la,
Sorry the BBCode tags.
The CSS is

  • {
    margin: 0;
    padding: 0;
    }

This is a very useful bit of code, used to reset everything that a
browser might do by default back to “known base” values. Then you
build up from there, adding padding and margins to elements that you
want to style. This keeps the page looking the way you expect in as
many browsers as possible.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On Nov 2, 2007, at 2:55 PM, Todd wrote:

So for example in my IE5 stylesheet could I add the below CSS then go
back through and add the proper margins and paddings to each element
and/or style. Am I understanding that correctly?

Todd

Yes. I just followed the link that JJBee posted, it’s quite a romp
through the code – you should read the page and the comments.

The idea is that there are dozens of little quirks hiding in the
browsers’s default stylesheets (the properties that they will each
apply to the basic building blocks of the HTML page). If you don’t
write stylesheets that provide some value for each and every single
property of these elements (and nobody does, usually) then you will
at some point, in some browser, end up seeing these defaults instead
of the defaults of the browser you used to proof your work. This in
turn will cause your layout to be different that you expect in that
foreign browser.

Now if you do reset everything, you have to add it all back.
Otherwise you end up with a page that looks like all the text crashed
into each other. But if you do, then you will know what size
everything will end up being.

Walter


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Sometime around 2/11/07 (at 14:39 -0400) JJBee said:

Beside that, it seems like BBCode tags work so sorry for my useless
previous post.

BBCode tags don’t work in my email - I would appreciate it if people
just post the full-qualified URL itself rather than trying funky
pseudo-code stuff. Ta! :slight_smile:

http://leftjustified.net/journal/2004/10/19/global-ws-reset/ works
fine, and I can see where it will take me before I click it.

k


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options