By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,940 Members | 1,328 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,940 IT Pros & Developers. It's quick & easy.

CSS to change font

P: n/a
JCO
How would you modify this to include font color to be white:
<style type="text/css">ul,ol{color:white;}</style>

I tried this, but it did not work:
<style type="text/css">font color="#FFFFFF",ul,ol{color:white;}</style>
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Tue, 02 Mar 2004 14:02:10 GMT, JCO <J.********@verizon.net> wrote:
How would you modify this to include font color to be white:
<style type="text/css">ul,ol{color:white;}</style>
CSS is off-topic in this group. Please refer style sheet questions to
comp.infosystems.www.authoring.stylesheets in the future.
I tried this, but it did not work:
<style type="text/css">font color="#FFFFFF",ul,ol{color:white;}</style>


That's because it's an invalid selector. Read the specification regarding
selectors:
http://www.w3.org/TR/REC-CSS2/selector.html

If you're using CSS, why are you bothering with deprecated elements like
FONT, anyway?

Your solution would either be to use a styled SPAN element to surround
highlighted text (which I assume is your goal):

span.white, ul, ol {
/*
Make sure that an explicit background-color property
is specified here or in an ancestor.
*/
color: #ffffff;
}
...
<p>Some <span class="white">white</span> text</p>

....or to match the color attribute value in the font element:

font[color="#ffffff"], ul, ol {
color: #ffffff;
}

The latter won't work in IE, due to its abysmal CSS 2 support, though it
will render the font element. The first solution is obviously preferred.

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #2

P: n/a
JCO wrote:
How would you modify this to include font color to be white:
<style type="text/css">ul,ol{color:white;}</style>

I tried this, but it did not work:
<style type="text/css">font color="#FFFFFF",ul,ol{color:white;}</style>


No wonder it is not working, since it is invalid CSS at best:

<http://jigsaw.w3.org/css-validator/>

You are looking for either

body, ul, ol {
color:white;
}

or

* {
color:white;
}

(to format all elements) and comp.infosystems.www.authoring.stylesheets
where all this is on-topic.

Be sure to specify a proper background-color, too:
<http://www.w3.org/QA/Tips/color>
X-Post & F'up2 ciwas

PointedEars
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.