(Sally Thompson) wrote:
>On Thu, 17 Jun 2004 12:22:22 +0100, Steve Pugh <> wrote:
>> (Sally Thompson) wrote:
>>
>>>I've recently been revamping my first web site and have moved my menu
>>>to read down the left, using CSS. It all (HTML and CSS) validates,
>>>and looks fine in MSIE6 and Opera 7.23. The menu uses a <ul> within a
>>>div - <http://www.stonybrook-ludlow.co.uk/styles.css>
>>
>>http://jigsaw.w3.org/css-validator/v...1&profile=css2
>
>Whoops! Well, it did validate at one time but I've obviously changed
>something. However - I don't quite understand the error message which
>says:
>
> Invalid number : font too few values for the property normal 100% :
>normal 100%
>
>Can I not write { font: normal 100%; } in my CSS then? What should I
>write instead?
When you use the font shorthand you have several options, but if you
specify the font-size you must also specify the font-family.
The spec reads:
Value: [ [ <'font-style'> || <'font-variant'> ||
<'font-weight'> ]? <'font-size'> [ / <'line-height'> ]?
<'font-family'> ] | caption | icon | menu | message-box |
small-caption | status-bar | inherit
Which means
Either:
None or more of font-style, font-variant, font-weight
plus font-size
plus optionally / line-height
plus font-family
Or:
one of caption, icon, menu, message-box, small-caption, status-bar,
inherit
>>>Secondly, on a Mac using Safari the menu looks fine but on a page
>>>where I have thumbnails <http://www.stonybrook-ludlow.co.uk/pond.html>
>>>the thumbnails do not read across the screen from left to right, but
>>>down in a column. The extra stylesheet for this page is at
>>><http://www.stonybrook-ludlow.co.uk/stylespond.css>. I've recently
>>>changed this style sheet from using {float: left; } to using a
>>>container with {text-align: center; } to get the thumbs to overflow
>>>into the centre when they do not fit exactly on a line. How can I
>>>overcome this problem?
>>
>>Again Mozilla shows the same problem. Opera 7 and IE6 are only showing
>>what you want because your page triggers quirks mode wherein those two
>>browsers emulate the errors of IE5.
>>
>>The problem here is that your images are wrapped in <p> elements and
>><p> is a block element, and hence appears on a new line. Setting
>>displau: inline on the parent <div class="thumb"> really shouldn't
>>change that (IE is getting it wrong).
>>
>>What you really want is display: inline-block; but only Opera and
>>Safari support that at present. Tricky, let me have lunch and I'll see
>>if I can find a solution.
>
>Thanks, Steve - would be grateful for any input.
Well, I've had my lunch and I'm about to have my dinner, but I still
can't think of a way to do what you want in Mozilla.
Win IE5, IE6 (quirks mode), Opera 7 (quirks mode) - display: inline;
"works"
Opera 7 (standards mode), Safari, Mac IE5 (question mark on the last
two) - display: inline-block works.
Mozilla, IE6 (standards mode) - neither works. Best you could hope for
would be to degrade to left floated blocks.
Now, let's assume that you'll stick with quirks mode as that gives you
a working solution in Win IE6 and hence covers the largest group of
users.
So we do this:
div.thumb { display: inline; }
div[class="thumb"] {float: left;}
Win IE doesn't understand the second line so only sees the code as it
is at present. Better browsers understand the second line and left
float the divs which automatically sets them back to display: block;
(which we want as display: inline; means that the height and width
will be ignored).
The only problem is that Opera and Safari which can display the blocks
centered will now float them to the left. It is very difficult to
apply different styles in the latest versions of Mozilla, Opera and
Safari without resorting to nastiness such as javascript browser
sniffing.
Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor
Steve Pugh <> <http://steve.pugh.net/>