[UPHPU] More CSS frustration
cole at colejoplin.com
cole at colejoplin.com
Wed Jan 17 10:24:17 MST 2007
Hi Scott,
Quoting Scott Hill <llihttocs at gmail.com>:
> Wow! This is pretty intense for a plain table user.
Yes, I suppose that's true. I find tables pretty intense, now that I
don't use them for layout. Because I find this discussion interesting,
my wife is convinced it proves I am a nerd. ;)
> What is the significance of
> the '#' character in front of position and top? Why is it necessary? Can't
> you just leave it off?
It's my understanding that in this example the '#' is visible to all
versions of IE, but becomes invisible for all standard browsers. If
you remove the '#', they will be rendered by all browsers, changing
the vertical. This is just one strategy, from the IE side. There are
more.
Let's go the other way. For example, you could also use an underscore
before a property, like '_top' versus just 'top', which would do the
exact opposite. This would be read by standard browsers, but IE would
ignore it.
I've even seen people use both. A third strategy is to use a
combination of child selectors, adjacent selectors, and adjacent
sibling selectors. It's a lot more complicated, but a lot of fun to
watch someone else do. A great example of this is at
www.csszengarden.com/062. There is one design for standard browsers,
and a separate one for IE6 and lower. It's interesting that IE7 now
supports selectors to some extent. Check out the difference, it's
pretty funny.
You can play the browser-visible/invisible game, or just tweak the
line-height/padding/margins to make it look good on the actual pages
your creating. I tend to do the latter myself, as Wade was writing.
Even if the look is not 'identical', it's close enough. Two reasons
why I make this choice: 1) You keep the markup clean and 2) While you
can't future-proof per se, it minimizes the risk of severe render
breakage.
I'm not going to say there's a 'wrong' answer. For my personal taste,
I have a 'preferred' answer, which doesn't really take any more time
to implement than a table solution.
-- Cole
More information about the UPHPU
mailing list