wierd css

M

mark | r

ive noticed strange css combinations and would like an explination...

what does the chevron mean in

body>div {}
(dont know if thats a correct combination)

also anyone got any techniques for degradable css i believe having a rel
link containing an @import (or the other way round) is a good way of doing
it
and what shoukld be in the key css i know that nn4 etc doesnt like
background attributes but is there anything else?

thanks

mark
 
J

Jukka K. Korpela

mark | r said:
what does the chevron mean in

body>div {}

It's not a chevron but a greater than sign.

The construct body>div {...} means that the declarations assign (subject
to normal cascade rules) their property values to those div elements that
are sub-elements ("children") of the body element. That is, to those div
elements are inside the body element without intervening markup levels. In
<body>
<div>
<div>
</div>
</div>
also anyone got any techniques for degradable css i believe having a
rel link containing an @import (or the other way round) is a good way
of doing it

Various tricks can be used to prevent old browsers with buggy CSS support
from displaying the page all wrong. Graceful degradation, on the other
hand, means that your page behaves well if all or some of the style sheet
rules are not applied.
and what shoukld be in the key css i know that nn4 etc doesnt like
background attributes but is there anything else?

sry my gessing parser yust belw up maybe you should try putting too much
burden on your readers for example puntcuation and capsutal letters might
help hth
 
S

SpaceGirl

mark | r said:
ive noticed strange css combinations and would like an explination...

what does the chevron mean in

body>div {}
(dont know if thats a correct combination)

also anyone got any techniques for degradable css i believe having a rel
link containing an @import (or the other way round) is a good way of doing
it
and what shoukld be in the key css i know that nn4 etc doesnt like
background attributes but is there anything else?

thanks

mark


For the second part of your message; I use a serverside muncher that I wrote
(ASP) that eats up the browser header and spits out one of 3 CSS attachments
(or none at all) depending on what it finds. Currently it detects about 30
browser versions/platforms. You're welcome to a copy if you're using and MS
web server... it's pretty basic stuff (I'm no hardcore coder!).

Mirri
 
C

Chris Morris

SpaceGirl said:
For the second part of your message; I use a serverside muncher that I wrote
(ASP) that eats up the browser header and spits out one of 3 CSS attachments
(or none at all) depending on what it finds. Currently it detects about 30
browser versions/platforms.

Hmm, my log files currently have over 250 browsers (including
different versions) and gain more at an approximate rate of 2 or 3
each week. That's before considering faked UA headers and browsers
behind efficient caches, etc.
 
S

SpaceGirl

Chris Morris said:
Hmm, my log files currently have over 250 browsers (including
different versions) and gain more at an approximate rate of 2 or 3
each week. That's before considering faked UA headers and browsers
behind efficient caches, etc.

Even fake headers are pretty easy to check. Opera, for example, says it's
IE... but it also mentions the word "opera" in it's header. So it's fairly
easy to detect. Also bear in mind, if you're talking about commercial sites
for average users - you're not going to have to deal with many weird
browsers. With almost everyone using IE5/6, and the remainder using
Mozilla/Netscape 7+, it's pretty easy.

My script traps hundreds of browsers, but only specifically traps about 30.
Any in-between browsers are lumped with the most basic CSS attachement.

M.
 
C

Chris Morris

SpaceGirl said:
Even fake headers are pretty easy to check.

Er, no.
Opera, for example, says it's
IE...

(at some settings)
but it also mentions the word "opera" in it's header. So it's fairly
easy to detect.

Opera can be detected this way. Other browsers cannot, necessarily.

What browser produced this UA string, for example:
Mozilla/4.0 (compatible; MSIE 5.0; Windows 95)

A few seconds later it produced
Opera/4.03 (Windows NT 4.0; U)
then
Lynx/2.8.3dev.6 libwww-FM/2.14
then
Mozilla/4.76 (Macintosh; U; PPC)

None of those give any clue as to what it really is
Mozilla/5.0 (compatible; Konqueror/3.1; Linux 2.4.20-3-686; X11; i686; , en)
Also bear in mind, if you're talking about commercial sites
for average users - you're not going to have to deal with many weird
browsers.

Hmm, these log files aren't from a commercial site (mostly) but they
are on a site targeted at 'average users' with no technical
background.
With almost everyone using IE5/6, and the remainder using
Mozilla/Netscape 7+, it's pretty easy.

My script traps hundreds of browsers, but only specifically traps about 30.
Any in-between browsers are lumped with the most basic CSS attachement.

Even if they might be able to cope with more?

The techniques at
http://www.w3development.de/css/hide_css_from_browsers/ work fairly
well at letting you give the CSS content that's needed to the browsers
that need it.

Usually an @import and something to work around IE box-model is all
that's necessary.
 
S

SpaceGirl

Even fake headers are pretty easy to check.

Well there are always exception :)
(at some settings)


Opera can be detected this way. Other browsers cannot, necessarily.

What browser produced this UA string, for example:
Mozilla/4.0 (compatible; MSIE 5.0; Windows 95)

A few seconds later it produced
Opera/4.03 (Windows NT 4.0; U)
then
Lynx/2.8.3dev.6 libwww-FM/2.14
then
Mozilla/4.76 (Macintosh; U; PPC)

None of those give any clue as to what it really is
Mozilla/5.0 (compatible; Konqueror/3.1; Linux 2.4.20-3-686; X11; i686; ,
en)

How many people actually use this tho?
Hmm, these log files aren't from a commercial site (mostly) but they
are on a site targeted at 'average users' with no technical
background.

Around 96% of people on the Internet are IE users... do you have a niche
market? :)
Even if they might be able to cope with more?

Yep... there's a limit to what is economical for us to design for. It would
be hard to test anyway - I dont have 250 browsers installed on this PC :) We
test against Mozilla & IE5/6 on PC and Mac, and use dumbed-down CSS for
pretty much everything else.

The techniques at
http://www.w3development.de/css/hide_css_from_browsers/ work fairly
well at letting you give the CSS content that's needed to the browsers
that need it.

That's a cool link, thanks.
Usually an @import and something to work around IE box-model is all
that's necessary.

:)

M
 
C

Chris Morris

SpaceGirl said:
en)

How many people actually use this tho?

It's a little difficult to tell, given the number of fake UA headers
it can come up with. I saw 20 or so options...

After I've stripped out search engine UAs from the logs, it's the 8th
most popular UA to appear in log entries (for the little *that's*
worth as a statistic). However, it's (of course) hard to tell how
many of the Netscape/Mozilla/IE entries are it.

Also, the rendering engine (KHTML) it uses is the same as Safari,
which Apple are putting a lot of effort into for Mac OS X.
Around 96% of people on the Internet are IE users... do you have a niche
market? :)

It does get a lot of hits from the intranet where Netscape 7 is the
supported browser. I don't think it's a particularly niche market
from the point of view of 'likely browser use' either, and if only
accesses from outside the intranet are counted, it still gets over 200
different types (and the Konqueror browser moves into 6th place once
search engine UAs are ignored).

And substantiate your 96% figure bearing in mind things like
http://www.analog.cx/docs/webworks.html

I *really* doubt it's as high as 96% - logfile statistics from the
most commercial subsite (which is almost all external accesses, and
definitely no niche market from the point of view of browser use) give
only 85% IE (or faking it), with Konqeuror moving into 4th (it's like
the races this, wonder what subset of logs I can use to make it
1st...)

Of course, in all of this there's the unspoken and entirely
*incorrect* assumption that hits are proportional to users. I don't
know which way that's incorrect, whether IE users stay longer or for
less time. Someone probably does have a study somewhere.
Yep... there's a limit to what is economical for us to design for. It would
be hard to test anyway - I dont have 250 browsers installed on this PC :) We

No, I'll admit to not having that many either. I've got about 50,
though, and there's plenty in the log files that it'd be nice to have
(emulators for the mobile phone browsers would be *very* nice)
test against Mozilla & IE5/6 on PC and Mac, and use dumbed-down CSS for
pretty much everything else.

Test against Opera (most OSes) and either Konqueror (Linux KDE) or
Safari (Mac OS X) as well, Opera's far more capable than IE with CSS,
and KHTML isn't too bad. Not as good as Mozilla or Opera, but still
fairly good. Certainly there should be no call to drop all but the
really easy CSS for them.
 
R

Richard Cornford

Even fake headers are pretty easy to check. Opera,
for example, says it's IE... but it also mentions
the word "opera" in it's header. So it's fairly
easy to detect.

The fake headers that are easy to check are easy to check, the ones that
are indistinguishable from other browser's UA strings are impossible to
check. Opera may have decided to give out clues about which browser it
really is when spoofing IE but others do not. IceBrowser 5.4, for
example, uses the User Agent string (on Win 98):-

Mozilla/4.0 (compatible; MSIE 5.0; Windows 98)

- and there is nothing there to distinguish it from IE 5.0.
Also bear in mind, if you're talking about commercial
sites for average users - you're not going to have to
deal with many weird browsers. With almost everyone
using IE5/6, and the remainder using Mozilla/Netscape
7+, it's pretty easy.

Given browsers spoofing IE to the extent that they are indistinguishable
from IE, both remotely with the User Agent header and under more
detailed JavaScript examination, how do you know that almost everyone is
using IE 5/6? Intuition says that they probably are but there are no
facts to back up that assertion.
My script traps hundreds of browsers, but only specifically
traps about 30. Any in-between browsers are lumped with the
most basic CSS attachement.

And that is exactly why browsers do not honestly report their make and
model in their User Agent headers. If IceBrowser was honest you would be
sending it a basic CSS, but it is a full visual browser with CSS support
at leas as good as IE 5's.

Richard.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,076
Messages
2,570,565
Members
47,201
Latest member
IvyTeeter

Latest Threads

Top