Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Changing colors

Reply
Thread Tools

Changing colors

 
 
Anders Christiansen
Guest
Posts: n/a
 
      03-03-2004
This is most likely dead simple.. i just can't get it to work.

I want difrent color highlight on diffrent parts of my text. I want the
color of the text to be the same..

I hope someone can help me.

Regards Anders Christiansen


 
Reply With Quote
 
 
 
 
Andrew Urquhart
Guest
Posts: n/a
 
      03-03-2004
Anders Christiansen wrote:
> This is most likely dead simple.. i just can't get it to work.
>
> I want difrent color highlight on diffrent parts of my text. I want
> the color of the text to be the same..
>
> I hope someone can help me.
>
> Regards Anders Christiansen


Markup:
<p>This sentence <em>contains highlighted content</em> and makes sense
semantically</p>

CSS:
body {
color: #000000;
background-color: #ffffff;
}
p em {
color: #000000;
background-color: #fbe54f;
}
--
Andrew Urquhart
Reply: www.andrewu.co.uk/about/contact/


 
Reply With Quote
 
 
 
 
Ryan Stewart
Guest
Posts: n/a
 
      03-03-2004
"Anders Christiansen" <(E-Mail Removed)> wrote in message
news:c24ito$116q$(E-Mail Removed)...
> This is most likely dead simple.. i just can't get it to work.
>
> I want difrent color highlight on diffrent parts of my text. I want the
> color of the text to be the same..
>
> I hope someone can help me.
>
> Regards Anders Christiansen
>

<p style="color: red;">This is <span style="background-color: blue;">some
blue stuff and this is</span> <span style="background-color: green;">some
green stuff.</span>


 
Reply With Quote
 
Chris Morris
Guest
Posts: n/a
 
      03-03-2004
"Ryan Stewart" <(E-Mail Removed)> writes:
> "Anders Christiansen" <(E-Mail Removed)> wrote in message
> news:c24ito$116q$(E-Mail Removed)...
> > This is most likely dead simple.. i just can't get it to work.
> >
> > I want difrent color highlight on diffrent parts of my text. I want the
> > color of the text to be the same..
> >
> > I hope someone can help me.

>
> <p style="color: red;">This is <span style="background-color: blue;">some
> blue stuff and this is</span> <span style="background-color: green;">some
> green stuff.</span>


Remember that not every browser can display colour (and not every
person can distinguish colours well), so make sure if it's used for
essential information, there's another way to get at the information
too.

--
Chris
 
Reply With Quote
 
Anders Christiansen
Guest
Posts: n/a
 
      03-03-2004
I think i was misunderstood.

What i want is a text all in black, that when i mark it with the mouse shows
diffrent colors.. e.g.

this is a test <br><br>

When marked with the mouse it should look like this<br><br>

<span style="background-color: blue;"> <font color=red>this is <font color=
white>a test </span>



"Ryan Stewart" <(E-Mail Removed)> skrev i en meddelelse
news:(E-Mail Removed)...
> "Anders Christiansen" <(E-Mail Removed)> wrote in message
> news:c24ito$116q$(E-Mail Removed)...
> > This is most likely dead simple.. i just can't get it to work.
> >
> > I want difrent color highlight on diffrent parts of my text. I want the
> > color of the text to be the same..
> >
> > I hope someone can help me.
> >
> > Regards Anders Christiansen
> >

> <p style="color: red;">This is <span style="background-color: blue;">some
> blue stuff and this is</span> <span style="background-color: green;">some
> green stuff.</span>
>
>



 
Reply With Quote
 
Toby A Inkster
Guest
Posts: n/a
 
      03-03-2004
Anders Christiansen wrote:

> What i want is a text all in black, that when i mark it with the mouse shows
> diffrent colors.. e.g.


Can't be done. Mouse selection colour is entirely chosen by the visitor.

CSS3 may change that (it's introducing a few irritating things along those
lines, though I've not searched for that specifically.)

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

 
Reply With Quote
 
Bernhard Sturm
Guest
Posts: n/a
 
      03-03-2004


Anders Christiansen schrieb:
> I think i was misunderstood.
>
> What i want is a text all in black, that when i mark it with the mouse shows
> diffrent colors.. e.g.
>
> this is a test <br><br>
>
> When marked with the mouse it should look like this<br><br>
>
> <span style="background-color: blue;"> <font color=red>this is <font color=
> white>a test </span>


I don't know exactly why you want to achieve this, but you could set
some dummy link in order to achieve this (it's quirk however):

a.highlight {
text-decoration:none;
}
a.highlight:link {
color:red;
}
a.highlight:hoover {
color:white;
}

<span style="background-color:blue;color=red;">this is<a
href="javascript:;" class="highlight">a test</a></span>

but I don't know if it's what you want


bernhard
---
www.daszeichen.ch
remove nixspam to reply

 
Reply With Quote
 
Leif K-Brooks
Guest
Posts: n/a
 
      03-03-2004
Ryan Stewart wrote:
> <p style="color: red;">This is <span style="background-color: blue;">some
> blue stuff and this is</span> <span style="background-color: green;">some
> green stuff.</span>


Browsers may default paragraphs to having a red background, in which
case your text would become invisible. You should always set background
when setting color, and always set color when setting background.
 
Reply With Quote
 
Ryan Stewart
Guest
Posts: n/a
 
      03-03-2004
"Leif K-Brooks" <(E-Mail Removed)> wrote in message
news:RLr1c.98$(E-Mail Removed)...
> Ryan Stewart wrote:
> > <p style="color: red;">This is <span style="background-color:

blue;">some
> > blue stuff and this is</span> <span style="background-color:

green;">some
> > green stuff.</span>

>
> Browsers may default paragraphs to having a red background, in which
> case your text would become invisible. You should always set background
> when setting color, and always set color when setting background.


I'd assumed he would account for that, but yes, it's good to point out.


 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there any library that can convert RGB colors to ANSI colors? ZelluX Python 3 12-01-2008 11:08 AM
TreeNode colors come from anchor colors AAaron123 ASP .Net 1 08-07-2008 07:56 PM
TextBox changing colors Randy ASP .Net 1 10-26-2005 06:41 PM
Changing button colors in a loop No spam Java 0 03-04-2005 01:07 PM
Changing font colors in XP Desktop George M. Computer Support 2 04-09-2004 12:38 PM



Advertisments