Steve Pugh <st***@pugh.net > wrote in message news:<lk******* *************** **********@4ax. com>...
pe*******@yahoo .com (Peter Cartwright) wrote:
Interesting stuff, trouble is it deepens the confusion. All the time
I've used CSS I haven't tried setting a width to inline elements.
Because the W3C reference says width only applies to block and
replaced elements. Now that I've tried it - I find I can. Can someone
explain the discrepancy?
Which browsers are using your width style? And are you triggering
standards or quirks mode via your doctype?
Internet Explorer in quirks mode will do lots of things that it
shouldn't and hence is not a good guide to whether your code is
working as it should.
Steve
Yes that was it.
I had a closer look at the list menus but they won't work in this
case. That is a menu element that can either take the width of its
contents or have a fixed width - in other words a td. In any case the
list items aren't contained by the ul in Opera. And in IE there's an
unwanted margin-top (or whatever it is) on the li. See
http://website.lineone.net/~peterct07/list_version.htm
Using a table I think I've found a solution or several. I don't think
the padding-left or margin-left on anchors will work in IE5, which is
what I was referring to in an earlier post. But I've put up some
examples in case I'm wrong on that. Probably the inelegant example,
giving a float:left and width to a div sitting alongside the anchor,
is the best bet. I'd be surprised if it doesn't work, but can you tell
me what you find in IE5?
Incidentally Opera looks like it gets the first two examples wildly
wrong.
http://website.lineone.net/~peterct07/table_version.htm