Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 11:38 PM
Mel
Guest
 
Posts: n/a
Default is this a good practice ?

CAN YOU suggest an alternative ?

..heading, heading-R, heading-K, heading-G, heading-W {
font-family: arial,helvetica, ms sans serif, sans-serif;
font-size: 10pt;
font-style: normal;
font-weight: bold;
text-decoration: none;
}

..heading-R {
color: #7a3b3b;
}

..heading-K {
color: khaki;
}

..heading-G {
color: darkgreen;
}

..heading-W {
color: white;
}


  #2  
Old July 20th, 2005, 11:38 PM
David Dorward
Guest
 
Posts: n/a
Default Re: is this a good practice ?

Mel wrote:
[color=blue]
> CAN YOU suggest an alternative ?
>
> .heading, heading-R, heading-K, heading-G, heading-W {
> font-family: arial,helvetica, ms sans serif, sans-serif;[/color]

Fonts with spaces in them must be quoted.
[color=blue]
> font-size: 10pt;[/color]

Point units are highly unsuitable for use on screen.
http://css-discuss.incutio.com/?page=UsingPoints
[color=blue]
> .heading-K { color: khaki;}[/color]

khaki is not a colour in CSS
[color=blue]
> .heading-G { color: darkgreen;}[/color]

Ditto 'darkgreen'
[color=blue]
> .heading-W { color: white;}[/color]

Its a reasonable way of specifying multiple classes with similar properties.

You could also use multiple classes...

class="heading W"

then:

..head { la la la }
..W { color: white; }

However - the class names aren't very good. They should representing
meaning, not what things look like.

And you shouldn't use a class for a heading, HTML comes with h1, h2, h3 ...
h6 for that.

h2 { ... }
h2.cats { ... }
h2.dogs { ... }
h2.goats { ... }

.... might be you best bet.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
  #3  
Old July 20th, 2005, 11:38 PM
Harlan Messinger
Guest
 
Posts: n/a
Default Re: is this a good practice ?


"Mel" <mehra.heravi@ssa.gov> wrote in message
news:c8g50g$gcb$1@s0b1a68.ssa.gov...[color=blue]
> CAN YOU suggest an alternative ?
>
> .heading, heading-R, heading-K, heading-G, heading-W {
> font-family: arial,helvetica, ms sans serif, sans-serif;
> font-size: 10pt;
> font-style: normal;
> font-weight: bold;
> text-decoration: none;
> }
>
> .heading-R {
> color: #7a3b3b;
> }
>
> .heading-K {
> color: khaki;
> }
>
> .heading-G {
> color: darkgreen;
> }
>
> .heading-W {
> color: white;
> }[/color]

You must have some basis for deciding which headings should be khaki, which
should be dark green, and which should be white--that is, they must reflect
some kind of grouping. What if you decided that instead of khaki, you wanted
the khaki ones to be tan? Would you go through all your web pages and change
every instance of class="heading-K" to class="heading-T"? Or would you
change only the style, and then leave it to future generations to be
confused about why "heading-K" means "tan"?

The point is that the names of styles shouldn't reflect the details of the
style, they should reflect the defining characteristic of the page elements
to which you want to apply the style. If your site has three special
sections for math, science, and history, then use

.heading-math { color: khaki; }

and so forth. Then if you decide math headings should be tan, you only have
to change the style's definition; the style's name will still make as much
sense as it did originally.

Besides that, you shouldn't use the names "khaki" and "darkgreen" because
they are not standard CSS color terms and not all browsers will understand
them. Use RGB values instead: "#F0E68C" and "#006400". Even safer, stick to
colors that use multiples of 17 (11 hex): "#EEDD88" (or "#ED8") and
"#006600" (or "#060").

  #4  
Old July 20th, 2005, 11:38 PM
Brian
Guest
 
Posts: n/a
Default Re: is this a good practice ?

Mel wrote:[color=blue]
> CAN YOU suggest an alternative ?[/color]

To what? What do you want?
[color=blue]
> .heading, heading-R, heading-K, heading-G, heading-W {
> font-family: arial,helvetica, ms sans serif, sans-serif;[/color]

[snip]

I dunno, how about some real markup?

H1 {
font-family: sans-serif;
font-size: 140%;
color: #008000;
background: #ffffff;
}

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
  #5  
Old July 20th, 2005, 11:40 PM
Keith Bowes
Guest
 
Posts: n/a
Default Re: is this a good practice ?

Mel wrote:
[color=blue]
>
> .heading, heading-R, heading-K, heading-G, heading-W[/color]

Are all four of these supposed to be class selectors? If so, use a dot
before them all, not just the first one. If not, I'm sorry for wasting
your time.

  #6  
Old July 20th, 2005, 11:40 PM
Keith Bowes
Guest
 
Posts: n/a
Default Re: is this a good practice ?

Harlan Messinger wrote:[color=blue]
>
> Besides that, you shouldn't use the names "khaki" and "darkgreen" because
> they are not standard CSS color terms[/color]

However, they are in the CSS 3 Color Module, which is a W3C Candidate
Recommendation. IMHO, using those color names shouldn't be too harmful.

  #7  
Old July 20th, 2005, 11:40 PM
Harlan Messinger
Guest
 
Posts: n/a
Default Re: is this a good practice ?

Keith Bowes <do.not@spam.me> wrote:
[color=blue]
>Harlan Messinger wrote:[color=green]
>>
>> Besides that, you shouldn't use the names "khaki" and "darkgreen" because
>> they are not standard CSS color terms[/color]
>
>However, they are in the CSS 3 Color Module, which is a W3C Candidate
>Recommendation. IMHO, using those color names shouldn't be too harmful.[/color]

I advised someone not to use non-standard, poorly supported code,
under the assumption that he wants his pages to work for as many
people as possible. This is a case where only a trivial effort can
increase the frequency with which his pages will be rendered
correctly. Do you think that's a bad idea? What does harm have to do
with it?

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
  #8  
Old July 20th, 2005, 11:40 PM
Lauri Raittila
Guest
 
Posts: n/a
Default Re: is this a good practice ?

Keith Bowes wrote:[color=blue]
> Harlan Messinger wrote:[color=green]
> >
> > Besides that, you shouldn't use the names "khaki" and "darkgreen" because
> > they are not standard CSS color terms[/color]
>
> However, they are in the CSS 3 Color Module, which is a W3C Candidate
> Recommendation. IMHO, using those color names shouldn't be too harmful.[/color]

OTOH, it is pretty hard to figure out what some color looks from its
name, hexcode is much more readable...

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
I'm looking for work | Etsin työtä
  #9  
Old July 20th, 2005, 11:40 PM
Alan J. Flavell
Guest
 
Posts: n/a
Default Re: is this a good practice ?

On Sun, 23 May 2004, Keith Bowes wrote:
[color=blue]
> Harlan Messinger wrote:[color=green]
> >
> > Besides that, you shouldn't use the names "khaki" and "darkgreen" because
> > they are not standard CSS color terms[/color][/color]

Also, it's good practice when specifying text colour to always specify
background colour, and vice versa. I.e specify either both of them or
neither of them, at each level of specificity that's used. See
previous discussions for details, and if warnings are enabled in the
W3C CSS "validator" then it'll call attention to this issue.
[color=blue]
> However, they are in the CSS 3 Color Module, which is a W3C Candidate
> Recommendation.[/color]

alright
[color=blue]
> IMHO, using those color names shouldn't be too harmful.[/color]

I can't agree, unless you choose *both* text *and* background colours
by using names which aren't in CSS2. Even then, you risk hitting a
browser which is too clever for its own good, and recognises some
colour names which aren't in CSS2 while not recognising others.

Suppose, for instance, that you set the text colour to "white" and the
background to "darkgreen". Assume that the browser's default
background is white.

So a browser which correctly supports CSS2 will display white text
(since "white" is in the CSS2 repertoire) against the default white
background (since "darkgreen" is not). "Shouldn't be too harmful"?

I really think this is all an unfortunate mistake by the designers of
the language. CSS should be defined for its resilience as an
interworking language - not for the convenience of authors. If they
don't know what RGB values to assign to "darkgreen", then their
authoring tools should be able to tell them, and insert -that- into
the stylesheet, IMHO.

cheers
  #10  
Old July 20th, 2005, 11:40 PM
Alan J. Flavell
Guest
 
Posts: n/a
Default Re: is this a good practice ?

On Sun, 23 May 2004, Alan J. Flavell wrote:
[color=blue]
> I really think this is all an unfortunate mistake by the designers of
> the language. CSS should be defined for its resilience as an
> interworking language - not for the convenience of authors. If they
> don't know what RGB values to assign to "darkgreen", then their
> authoring tools should be able to tell them, and insert -that- into
> the stylesheet, IMHO.[/color]

Developing this argument further, if I may...

Take a look at the "rules for handling parsing errors", e.g at
http://www.w3.org/TR/REC-CSS2/syndat...parsing-errors

The rule concerning an illegal *value* is that the specific
*declaration* must be ignored, but the other declarations in the same
group will still be parsed and used. Allowing CSS declarations to be
collected into "groups" seems to be for nothing more than convenience.

It occurs to me that it's at least arguable that an illegal or
unrecognised value within a group ought to cause the *whole group* to
be ignored.

div.w { color: white; blackground-color: darkgreen;
font-family: wibble; }

If the browser doesn't recognise "darkgreen", then it seems to me that
it's less harmful if it also discards the declaration which specifies
white text. There's no other "conditional" mechanism in CSS to
achieve that.

In my above example, it would also discard the font-family
specification in these circumstances. Suppose you wanted to specify
font family "wibble" regardless of whether the colour declarations
were accepted, then (under these suggested rules) you would code this
instead:

div.w { color: white; blackground-color: darkgreen; }
div.w { font-family: wibble; }

That would then give the grouping mechanism a genuine technical reason
to exist, rather than being a mere coding shorthand as it appears to
be at present. And IMHO it should be capable of giving better
compatibility behaviour when older clients are used to render newer
versions of CSS. Provided of course that CSS authors understand the
idea, and apply it appropriately.

To be candid, I'm making this up as I go along, so feel free to tell
me that it's all been discussed before, and rejected, and I missed the
discussion; or whatever else is wrong with it. And, admittedly I'm
raising this too late now, since the behaviours of CSS2-ish browsers
that are out there aren't going to change merely by some waving of the
W3C revision pen, even if the W3C were to be convinced that it was a
reasonable idea. Ho hum.
  #11  
Old July 20th, 2005, 11:41 PM
Eric Bustad
Guest
 
Posts: n/a
Default Re: is this a good practice ?

Keith Bowes wrote:
[color=blue]
> Harlan Messinger wrote:
>[color=green]
>> Besides that, you shouldn't use the names "khaki" and "darkgreen" because
>> they are not standard CSS color terms[/color]
>
> However, they are in the CSS 3 Color Module, which is a W3C Candidate
> Recommendation. IMHO, using those color names shouldn't be too harmful.[/color]

"The table below provides a list of the X11 colors supported by popular
browsers."

This doesn't say that browsers supporting CSS3 should or should not
support these color names, just taht *some* browsers do support them.
What the hell is this kind of statement doing in a Recommendation/Standard?

= Eric

  #12  
Old July 20th, 2005, 11:45 PM
Dr John Stockton
Guest
 
Posts: n/a
Default Re: is this a good practice ?

JRS: In article <Pine.LNX.4.53.0405231402100.7958@ppepc56.ph.gla.a c.uk>
, seen in news:comp.infosystems.www.authoring.stylesheets, Alan J.
Flavell <flavell@ph.gla.ac.uk> posted at Sun, 23 May 2004 14:23:08 :
[color=blue]
>. Even then, you risk hitting a
>browser which is too clever for its own good, and recognises some
>colour names which aren't in CSS2 while not recognising others.[/color]

Is there a list of colour names which I can use in safety, and if so
where/what?

I need them to be recognised by Win98/MSIE4; and I want them to be
recognised by browsers up to say six years old and, as far as can be
foretold, in years ahead.

These 16 I "know" to be safe :
aqua black blue fuchsia gray green lime maroon
navy olive purple red silver teal white yellow

MSIE4 knows more; but MSIE6 does not know all that Netscape have listed.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; Win98. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.
  #13  
Old July 20th, 2005, 11:45 PM
Claire Tucker
Guest
 
Posts: n/a
Default Re: is this a good practice ?

On Tue, 25 May 2004 13:40:23 +0100, Dr John Stockton
<spam@merlyn.demon.co.uk> wrote:[color=blue]
>
>I need them to be recognised by Win98/MSIE4; and I want them to be
>recognised by browsers up to say six years old and, as far as can be
>foretold, in years ahead.
>
>These 16 I "know" to be safe :
> aqua black blue fuchsia gray green lime maroon
> navy olive purple red silver teal white yellow
>
>MSIE4 knows more; but MSIE6 does not know all that Netscape have listed.
>[/color]

The only real "safe" option is to specify exactly which colour you
require as a hexadecimal value. Even if these keywords are supported,
there is always the chance that some browser will use a different
colour for some of them than you are expecting, and you probably won't
even notice right away.

The best idea is just to specify an explicit colour, and then there
cannot be any doubt as to which colour you were referring to.
(Ignoring monitor gamma issues, which you can't really do a whole lot
about and which the user will be used to anyway.)

-Claire
  #14  
Old July 20th, 2005, 11:45 PM
George Lund
Guest
 
Posts: n/a
Default Re: is this a good practice ?

In message <Pine.LNX.4.53.0405231457430.7958@ppepc56.ph.gla.a c.uk>, Alan
J. Flavell <flavell@ph.gla.ac.uk> writes[color=blue]
>To be candid, I'm making this up as I go along, so feel free to tell
>me that it's all been discussed before, and rejected, and I missed the
>discussion; or whatever else is wrong with it. And, admittedly I'm
>raising this too late now, since the behaviours of CSS2-ish browsers
>that are out there aren't going to change merely by some waving of the
>W3C revision pen, even if the W3C were to be convinced that it was a
>reasonable idea. Ho hum.[/color]

See discussions around
http://lists.w3.org/Archives/Public/...1Jul/0215.html
(the nearest archived post I could quickly find)

It's not like we weren't telling them these things years ago. I
remember being quite disappointed at the level of responses I tended to
get... if you go back in that thread far enough I say that I 'mentioned
the idea before' even then :-|

--
George Lund
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles