Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 24th, 2005, 12:56 AM
opt_inf_env@yahoo.com
Guest
 
Posts: n/a
Default One sentence beyond css.

Hi,

my *.css file contains the following line:

body {background-color: black; color: blue;}

It means that text in body will be blue. However I would like to put
one sentence in my text wich (sentence) have to have another color (not
blue). Can you tell me how it can be done?

Thank you.

  #2  
Old July 24th, 2005, 12:56 AM
kaeli
Guest
 
Posts: n/a
Default Re: One sentence beyond css.

In article <1111765182.572504.166460@g14g2000cwa.googlegroups .com>,
opt_inf_env@yahoo.com enlightened us with...[color=blue]
> Hi,
>
> my *.css file contains the following line:
>
> body {background-color: black; color: blue;}
>
> It means that text in body will be blue. However I would like to put
> one sentence in my text wich (sentence) have to have another color (not
> blue). Can you tell me how it can be done?[/color]

..green {color:green;}

<span class="green">this text is green</span>

--
--
~kaeli~
If God dropped acid, would he see people?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

  #3  
Old July 24th, 2005, 12:57 AM
David Ross
Guest
 
Posts: n/a
Default Re: One sentence beyond css.

opt_inf_env@yahoo.com wrote:[color=blue]
>
> Hi,
>
> my *.css file contains the following line:
>
> body {background-color: black; color: blue;}
>
> It means that text in body will be blue. However I would like to put
> one sentence in my text wich (sentence) have to have another color (not
> blue). Can you tell me how it can be done?
>
> Thank you.[/color]

I would strongly urge you not to have blue text against a black
background. It's almost unreadable. While aqua provides much
better contrast than blue against a black background, it might
still create problems for anyone who is colorblind.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.
  #4  
Old July 24th, 2005, 12:57 AM
Lachlan Hunt
Guest
 
Posts: n/a
Default Re: One sentence beyond css.

kaeli wrote:[color=blue]
> .green {color:green;}[/color]

That doesn't really seperate structure and content from the presentation
does it, it simply stacks another layer on top of it. What happens when
the author decides to use a new theme and green is no longer
appropriate? Should all the markup be changed to match, or just the CSS
(which would make it inconsistent and confusing.)

eg.
..green { color: red; } ???

[color=blue]
> <span class="green">this text is green</span>[/color]

It depends what you are trying to markup, not what you want it to look
like. If, for example, you want emphasis to be shown in green, you
could use

<em>emphasised text</em>

em { color: green; }

http://www.w3.org/QA/Tips/goodclassnames

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox
  #5  
Old July 24th, 2005, 12:59 AM
me
Guest
 
Posts: n/a
Default Re: One sentence beyond css.

"Lachlan Hunt" <spam.my.gspot@gmail.com> wrote in message
news:4244d73f$0$15986$5a62ac22@per-qv1-newsreader-01.iinet.net.au...[color=blue]
> kaeli wrote:[color=green]
> > .green {color:green;}[/color]
>
> That doesn't really seperate structure and content from the presentation
> does it, it simply stacks another layer on top of it. What happens when
> the author decides to use a new theme and green is no longer
> appropriate? Should all the markup be changed to match, or just the CSS
> (which would make it inconsistent and confusing.)
>
> eg.
> .green { color: red; } ???
>
>[color=green]
> > <span class="green">this text is green</span>[/color]
>
> It depends what you are trying to markup, not what you want it to look
> like. If, for example, you want emphasis to be shown in green, you
> could use
>
> <em>emphasised text</em>
>
> em { color: green; }
>
> http://www.w3.org/QA/Tips/goodclassnames
>
> --
> Lachlan Hunt[/color]

After reading the link I see your suggestion is quite good. If someone
wanted a special one time only style I would add the following:

..special { font-weight: bold; color: #FF0000}

I would add this comment to the style:

/* color red emphasis bold */

I would then add this to the body:

<span class="special">Bold Red Text</span>

If needed I would adapt the comment to describe any additional formattting
too, of course this is all OT in this NG. ;-)
Signed,
me


  #6  
Old July 24th, 2005, 12:59 AM
kaeli
Guest
 
Posts: n/a
Default Re: One sentence beyond css.

In article <4244d73f$0$15986$5a62ac22@per-qv1-newsreader-01.iinet.net.au>,
spam.my.gspot@gmail.com enlightened us with...[color=blue]
> kaeli wrote:[color=green]
> > .green {color:green;}[/color]
>
> That doesn't really seperate structure and content from the presentation
> does it, it simply stacks another layer on top of it. What happens when
> the author decides to use a new theme and green is no longer
> appropriate? Should all the markup be changed to match,[/color]

Well, I do.
*shrugs*

Then again, I actually keep everything in one document (one CSS and one html
template), so it's not hard to.

--
--
~kaeli~
Every calendar's days are numbered.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

 

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