为什么我的css不改变链接颜色? [英] why doesn't my css change link color?

查看:137
本文介绍了为什么我的css不改变链接颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

非常简单(我希望)


我有一个css样式表,就像这样开始:


______________


答:链接{

颜色:cc9933;

}

答:vlink {

颜色:cc9933;

text-decoration:none;

}


A:活跃{

颜色:cc9933;

text-decoration:none;

}


..catalog {


仓位:绝对;

剩余:180;

顶部:570;

显示:阻止;

text-align:center;

text-indent:0.000000pt;

margin-top:0.000000pt;

margin-bottom:0.000000pt;

margin-right:0.000000pt;

margin-left:0.000000pt;

字体-size:10.000000pt;

font-weight:bold;

font-variant:small-caps;

font-style:normal;

颜色:cc9933;

text-decoration:none;

vertical-align:baseline;

text- TRAN sform:none;

font-family:" arial";

letter-spacing:0.1em;


}

_________________

然后是一个链接到它的网页,其条目如下:


< P CLASS =" ; catalog">< A HREF =" catalog.html">目录< / A>< / P>


一切正常但除了:为什么我不能覆盖

浏览器上的链接颜色? (IE 5.5)无论我尝试什么,

浏览器本地设置都会确定链接颜色。访问过的链接颜色似乎从CSS中选择了

,但链接颜色会改变为浏览器

设置。我希望所有情况下的颜色都是cc9933。我做了什么?b $ b做错了什么?谢谢

请回复:

jf **** @ yahoo.com

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.html"> 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.com

推荐答案

jf****@yahoo.com 写道:
jf****@yahoo.com wrote:
A:链接{
颜色:cc9933;
}


错误。应该是#cc9933;


还应该有背景颜色以避免与用户发生冲突

样式表。


.catalog {

职位:绝对;
左:180;
顶部:570;


错误。必须始终包含所有长度的单位。那是180英里

还是180埃?

显示:阻止;
text-align:center;
text-indent:0.000000pt;
margin-top:0.000000pt;
margin-bottom:0.000000pt;
margin-right:0.000000pt;
margin-left:0.000000pt;


一个简单的0就足够了。


我是否检测到MS Office挤压样式?

font-size: 10.000000pt;


pt是印刷媒体的一个单位,它们不太适合屏幕显示



font-weight:粗体;
font-variant:small-caps;
font-style:normal;
颜色:cc9933;
text-decoration:none;
vertical-align:基线;


垂直对齐对块元素没有影响。

text-transform:none;
font-family:" arial";
字母间距:0.1em;

}



这是一个有用的工具:
http://jigsaw.w3.org/css-validator/


请回复:

jf **** @ yahoo.com
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.com




公开提问,得到答案公开。


史蒂夫


-

我的理论给你起见,我的异端愤怒你,

我从不回信,你也不喜欢我的领带。 - 医生


Steve Pugh< st *** @ pugh.net> < http://steve.pugh.net/>



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/>


Stephen Poley schrieb:
Stephen Poley schrieb:

2003年6月28日01 :30:00-0700, jf****@yahoo.com 写道:

On 28 Jun 2003 01:30:00 -0700, jf****@yahoo.com wrote:
非常简单的事情(我希望)
very simple thing (I hope)



是的,它是。



Yes, it is.

我有一个css样式表开始像这个:

A:链接{
颜色:cc9933;
I''ve got a css style sheet that starts like this:

A:link {
color: cc9933;


...


...

我做错了什么?



将CSS提交给验证者:

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

将全部揭晓。



Submit your CSS to the validator:

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

and all will be revealed.




我知道W3C自己称之为验证器,但你不能真的

" validate" CSS。

Matthias



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


6月28日星期六,Matthias Gutfeldt刻在永恒的卷轴上:
On Sat, Jun 28, Matthias Gutfeldt inscribed on the eternal scroll:
我知道W3C自己称之为验证器,但你不能真正地验证。 CSS。
I know the W3C themselves call it a "validator", but you can''t really
"validate" CSS.




不是精确的SGML意义上的,不是,但是术语验证确实有一个

更普遍的含义。


这个肯定会进行CSS语法检查,以及其他一些

检查太。虽然遗憾的是术语验证器是指验证器。已被

误用于HTML / SGML / XML上下文中的某些人,它具有

精确的技术含义,肯定不会恕我直言不予其使用<在SGML有效性概念的其他技术环境中,
不适用。
欢呼



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


这篇关于为什么我的css不改变链接颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆