473,890 Members | 1,885 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

why doesn't my css change link color?

very simple thing (I hope)

I've got a css style sheet that starts like this:

______________

A:link {
color: cc9933;
}
A:vlink {
color: cc9933;
text-decoration: none;
}

A:active {
color: cc9933;
text-decoration: none;
}

..catalog {

position: absolute;
left: 180;
top: 570;
display: block;
text-align: center;
text-indent: 0.000000pt;
margin-top: 0.000000pt;
margin-bottom: 0.000000pt;
margin-right: 0.000000pt;
margin-left: 0.000000pt;
font-size: 10.000000pt;
font-weight: bold;
font-variant: small-caps;
font-style: normal;
color: cc9933;
text-decoration: none;
vertical-align: baseline;
text-transform: none;
font-family: "arial";
letter-spacing: 0.1em;

}
_______________ __
Then a Web page that's linked to it with entries like this:

<P CLASS="catalog" ><A HREF="catalog.h tml"> catalog</A></P>

Everything works fine EXCEPT: why can't I override the link colors on
my browser? (IE 5.5) No matter what I try, the settings locally on the
browser determine the link color. The visited link color seems to pick
up from the CSS, but the link color changes to whatever the browser
settings are. I want the color in all cases to be cc9933. What am I
doing wrong? Thanks
please reply to:

jf****@yahoo.co m
Jul 20 '05 #1
12 15334
jf****@yahoo.co m wrote:
A:link {
color: cc9933;
}
Error. Should be #cc9933;

Should also have a background colour to avoid clashes with user
stylesheets.

.catalog {

position: absolute;
left: 180;
top: 570;
Error. Must always include units with all lengths. Is that 180 miles
or 180 Angstrom?
display: block;
text-align: center;
text-indent: 0.000000pt;
margin-top: 0.000000pt;
margin-bottom: 0.000000pt;
margin-right: 0.000000pt;
margin-left: 0.000000pt;
A simple 0 would suffice.

Do I detect MS Office extruded styles?
font-size: 10.000000pt;
pt are a unit from the print media, they are not well suited to screen
displays.
font-weight: bold;
font-variant: small-caps;
font-style: normal;
color: cc9933;
text-decoration: none;
vertical-align: baseline;
Vertical align has no effect on block elements.
text-transform: none;
font-family: "arial";
letter-spacing: 0.1em;

}

Here's a useful tool:
http://jigsaw.w3.org/css-validator/

please reply to:

jf****@yahoo.c om


Ask the question in public, get the answer in public.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net > <http://steve.pugh.net/>
Jul 20 '05 #2
Stephen Poley schrieb:

On 28 Jun 2003 01:30:00 -0700, jf****@yahoo.co m wrote:
very simple thing (I hope)


Yes, it is.
I've got a css style sheet that starts like this:

A:link {
color: cc9933;

...
What am I doing wrong?


Submit your CSS to the validator:

http://jigsaw.w3.org/css-validator/validator-uri.html

and all will be revealed.


I know the W3C themselves call it a "validator" , but you can't really
"validate" CSS.
Matthias
Jul 20 '05 #3
On Sat, Jun 28, Matthias Gutfeldt inscribed on the eternal scroll:
I know the W3C themselves call it a "validator" , but you can't really
"validate" CSS.


Not in the precise SGML sense, no, but the term "validate" does have a
more general meaning too.

This one certainly does CSS syntax checking, and some other kinds of
checks too. While it's a pity that the term "validator" has been
misused by some people in HTML/SGML/XML contexts, where it has a
precise technical meaning, that surely doesn't IMHO rule out its use
in other technical contexts where the concept of SGML validity does
not apply.

cheers
Jul 20 '05 #4
Alan J. Flavell wrote:
On Sat, Jun 28, Matthias Gutfeldt inscribed on the eternal scroll:

I know the W3C themselves call it a "validator" , but you can't really
"validate" CSS.

Not in the precise SGML sense, no, but the term "validate" does have a
more general meaning too.

This one certainly does CSS syntax checking, and some other kinds of
checks too. While it's a pity that the term "validator" has been
misused by some people in HTML/SGML/XML contexts, where it has a
precise technical meaning, that surely doesn't IMHO rule out its use
in other technical contexts where the concept of SGML validity does
not apply.


Yes, I can understand that point of view. But blurring the line between
validation and "validation " can lead to misconceptions down the road, so
that even webdesigners no longer seem to know there is a difference.

For example:

"Validate the CSS
CSS can be validated with for example the W3C CSS validator. This is
much the same as HTML validation, except that I have not yet come across
any good reason for using any invalid CSS declarations."
<http://www.xs4all.nl/~sbpoley/webmatters/checklist.html# css>

This otherwise fine text ignores the big difference between HTML
validation and CSS "validation " completely, and states they are "much
the same", which they clearly are not. (Just using this example to
illustrate my point, I'm not trying to pick on you Stephen!).
Matthias

Jul 20 '05 #5
On Mon, 30 Jun 2003 09:04:32 +0200, Matthias Gutfeldt <wo***@gmx.at >
wrote:
"Validate the CSS
CSS can be validated with for example the W3C CSS validator. This is
much the same as HTML validation, except that I have not yet come across
any good reason for using any invalid CSS declarations."
<http://www.xs4all.nl/~sbpoley/webmatters/checklist.html# css>

This otherwise fine text ignores the big difference between HTML
validation and CSS "validation " completely, and states they are "much
the same", which they clearly are not. (Just using this example to
illustrate my point, I'm not trying to pick on you Stephen!).


Always willing to learn. How would you explain the difference in a few
words? Bearing in mind that this is intended to be from the viewpoint of
the *user* of the validator/whatever, not from the viewpoint of the
author of it.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #6
Stephen Poley <sb*****@xs4all .nl> wrote:
This otherwise fine text ignores the big difference between HTML
validation and CSS "validation " completely, and states they are
"much the same", which they clearly are not. (Just using this
example to illustrate my point, I'm not trying to pick on you
Stephen!).
Always willing to learn. How would you explain the difference in a
few words?


May I? It's my pet peeve, after all. :-)

There is no such thing as HTML validation, much less CSS validation.
There's SGML and XML validation, which might be used for DTDs developed
for (or, rather, retrofitted to) HTML, but surely not for any DTD
developed for CSS, since there isn't any.

For an indirect explanation - via explaining what validation is and
what it isn't - in far more words, see
http://www.cs.tut.fi/~jkorpela/html/validation.html

Many people say that I'm nitpicking and that any checking can be called
"validation ". I wonder why we would say "validate" if we _mean_
"check", which is a nice, well-known monosyllable. But apparently it
lacks the technospirit that makes things sexy and cool. Anyway, _I_
still say "check" when I mean 'check', and use "validate" _in the Web
context_ in one of the well-defined technical meanings as a _term_.
(There's enough confusion already when HTTP has "validation ", but most
Web authors don't have (or need) a clue of _that_ validation.)
Bearing in mind that this is intended to be from the
viewpoint of the *user* of the validator/whatever, not from the
viewpoint of the author of it.


From the viewpoint of the user, both validation and other checks are
worse than useless if the user does not understand what's going on,
i.e. does not know the rules of the notation (or "language", to use the
common misnomer) he's using and _how_ the validator or checker checks
against the rules, and which part of which rules. Calling CSS checkers
"validators " tends to make such understanding harder.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #7
Christoph Paeper wrote:
*Evertjan.* <ex************ **@interxnl.net >:
A:active {
color: #cc9933;
}

A:hover {
color: #00ff00;
}

Will the hyperlink ever have the colour #C93?
:active and :hover are not mutually exclusive states (:link and :visited
are), thus the latter overwrites the former. In most cases the correct order
of pseudo classes for links is :link, :visited, :hover, (:focus,) :active.

Well, with keyboard navigation or the like you'd probably see the :active
style, but never the :hover.


I always understood that :active (ie. the period while the user holds
down the mouse button) overrode :hover.

Certainly it works this way under Mozilla 1.3 for the following code:

<body>
<style>
<!--
a:hover { color: #00DD00 }
a:active { color: #00DDDD }
-->
</style>

<a href="#">link here</a>
</body></html>

Jul 20 '05 #8
GuruJ <Gu***@mbox.com .au> writes:
I always understood that :active (ie. the period while the user holds
down the mouse button) overrode :hover.
Not necessarily.
Certainly it works this way under Mozilla 1.3 for the following code: <style> <style type="text/css">, surely. a:hover { color: #00DD00 }
a:active { color: #00DDDD }
</style>

<a href="#">link here</a>


Try swapping the two lines in the stylesheet and you'll discover that
it doesn't *always* work that way.

The later style overrides the earlier style for the same specificity.

--
Chris
Jul 20 '05 #9
On Mon, 30 Jun 2003 11:36:28 +0000 (UTC), "Jukka K. Korpela"
<jk******@cs.tu t.fi> wrote:
Stephen Poley <sb*****@xs4all .nl> wrote:
This otherwise fine text ignores the big difference between HTML
validation and CSS "validation " completely, and states they are
"much the same", which they clearly are not. (Just using this
example to illustrate my point, I'm not trying to pick on you
Stephen!).
Always willing to learn. How would you explain the difference in a
few words?


May I? It's my pet peeve, after all. :-)

There is no such thing as HTML validation, much less CSS validation.


Well, we've been here before. All I can say is that I have never met
anyone outside the c.i.w.a.* groups who considered validation to refer
exclusively to validation against a DTD. But that wasn't quite my
question.

<snip>
Bearing in mind that this is intended to be from the
viewpoint of the *user* of the validator/whatever, not from the
viewpoint of the author of it.

From the viewpoint of the user, both validation and other checks are
worse than useless if the user does not understand what's going on,
i.e. does not know the rules of the notation (or "language", to use the
common misnomer) he's using
I'd more or less agree with that - though it may still be useful if it
simply brings to the attention of the user that he does not know (some
of) the rules and prods him/her to rectify that situation.

But nothing in what you say indicates to me that there is any difference
between HTML and CSS in this respect. In both cases the user of the
validator^W program uses it to identify syntax errors which can then be
corrected. In both cases they concern errors which could lead to
undesirable rendition in some/all browsers. I can't yet see why my
phrase "much the same" is incorrect from the point of view of the user.
and _how_ the validator or checker checks
against the rules,
This I don't understand at all. It seems equivalent to suggesting you
shouldn't catch a train until you know how a locomotive works.
and which part of which rules.


--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
5684
by: Andrea | last post by:
Hi everyone. I'm working on a navigation menu (in a frameset) that I want to set the "active" link to black (the link that corresponds to the page displayed in the right side of the frame) to black. http://www.personal.psu.edu/axg251/wc In the original external style sheet, I set the a:link, a:visited, a:active, and a:hover. That works fine. In the navigation page, I call a function for onclick - it sets the
3
1825
by: Mason A. Clark | last post by:
This link is given in another thread: http://www.ccmeonline.org/agenda.html My Opera 7.23 in Windows XP will only show the links as black on gray. Not recognizable as links, although they work as links. I assume this is a css problem (possibly the mouseovers). This happens on the off-line saved pages as well as on line.
2
21350
by: carramba | last post by:
Hi! is it possible to change "selector" color in drop-down list? <select name="select" style="background-color: #ff0000"> <option style="background-color: #ff0000" value="1">Cony</option> <option style="background-color: #ffffff" value="2">Alex</option> <option style="background-color: #0000ff" value="3">Peter</option> </select>
18
10759
by: Jan Tuxen | last post by:
Jakob Nielsen in his most recent Alertbox (http://www.useit.com/alertbox/20040503.html) tells web authors to change the color of visited links. I agree to his purpose: Help users understand where they have been. I also agree to the background: Too many web authors keep uniform link colors or their pages, thereby confusing the users. What I have a hard time agreeing to is his conclusion that web authors should deliberately change the...
2
1839
by: Sheila King | last post by:
I have a test/mock-up page here: http://mathxy.com/dev/index.htm and I've set one link on the dark-blue menu bar the "Home" link that comes first and it is blue font, but should not be. Style sheet is here: http://mathxy.com/dev/default.css
18
10311
by: Denny Schierz | last post by:
hi, i want to change my link colors in the p class="suchen": That is my html: <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//DE" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
6
3343
by: Alpha | last post by:
I have several textboxes that I need to chang the text when the selection row is changed in a datagrid. I have the following code. This textbox displayes the initial selection but when I click on different rows in the datagrid, the textbox content doesn't change to reflect the change. How can I address this? Also, If the user change the text in the textbox then how do I refesh the display in the datagrid to reflect the changes? ...
3
8907
by: rn5a | last post by:
I want to change the background color of a row in a DataList when the mouse is moved over a row. This is how I tried but it doesn't change the background color of a row in the DataList when the mouse is moved over a row: <script runat="server"> Sub CreateItem(ByVal obj As Object, ByVal ea As DataListItemEventArgs) If (ea.Item.ItemType = ListItemType.Item Or ea.Item.ItemType = ListItemType.AlternatingItem) Then
2
2264
by: malcster2 | last post by:
hello, i am a beginner to ajax. i have created a mysql database, which i would like to access from a web page. i have created 3 files, a html to display the data, a php file to extract the data, and a javascript file to to the clever stuff. when i access the html page, all the data is displayed correcty, but if i add or delete any records, and press the button i have created to refresh the data(without reloading), the data doesn't change....
0
9812
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11212
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7154
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5832
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4655
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4255
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3263
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.