且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

链接xhtml中的颜色。

更新时间:2023-12-03 09:33:22

www.authoring.html op ********* @ yahoo .com 写道:
大家好,

我知道在html中设置访问和激活链接的颜色需要
使用格式如下:

< BODY text ="#FF0000"链接= QUOT;#0000FF&QUOT; ALINK = QUOT;#FFFF00&QUOT;的Vlink = QUOT;#00FF00&QUOT;&GT;


是的,过渡期

但是,我想用ch使用xhtml。


为什么选择xhtml?由于您不知道application / xhtml + xml的含义,请改用html4

strict。 (如果你知道这意味着什么,那么你可能会选择不使用它,但是不能再使用它了,但是不要再讨论了。)

在css文件中我有
body {background-color:black; color:blue;}

定义通常文本和背景的颜色。你知道怎么一个人需要修改这一行来指定访问和活动链接的颜色吗?


好​​吧,你可以添加

a:link {color:#00f;}

a:visited {color:#0c0; }

a:active {color:#ff0;}

a:link,a:active,a:visited,body {background:black}

所有都在同一行,但同样你可以有新的行...


使用背景速记来设置背景属性总是当你

设置颜色,如果你不打算使用所有单独的属性,那么你可以避免与用户类型的冲突。

另一个问题是,是否可以改变文本的颜色
链接,还有链接的背景,即一个单词后面的背景或对应链接的
句子?
Hello all,

I know that in html to set colors of visited and activ links one need
to use line in the following format:

<BODY text="#FF0000" link="#0000FF" alink="#FFFF00" vlink="#00FF00">
Yes, in transitional
However, I would like to use xhtml with css.
Why xhtml? As you don''t know what application/xhtml+xml means, use html4
strict instead. (if you know what it means, then you might choose not to
use it, buts lets not do that discussion again.)
In css-file I have the
next line:

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

which define color of usual text and background. Do you know how one
need to modify this line to specify colors of visited and active links?
Well, you can add
a:link {color:#00f;}
a:visited {color:#0c0;}
a:active {color:#ff0;}
a:link, a:active, a:visited, body {background:black}
all in same line, but just as well you can have new lines...

Use background shorthand to set background properties always when you
set colors, if you are not planning to use all individual attributes, as
that way you avoid conflicts with userstyles.
Another question is whether on can change not only colors of text in
link, but also background of link, i.e. background behind one word or
sentence which corespond to link?




当然。只需寻找您的CSS入门。哦,你还没有?然后你

大概是寻找常见问题,哦,我想你没有。也许这样做?


-

Lauri Raittila< http://www.iki.fi/lr> < http://www.iki.fi/zwak/fonts>

乌得勒支,NL。



Sure. Just look for your CSS primer. Oh, you didn''t already? Then you
presumably looked for FAQ, oh I guess you didn''t. Maybe do that?

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.


< op **** *****@yahoo.com>写道:
<op*********@yahoo.com> wrote:
我知道在html中设置访问和激活链接的颜色需要
使用以下格式的行:

< BODY text = &QUOT;#FF0000&QUOT;链接= QUOT;#0000FF&QUOT; ALINK = QUOT;#FFFF00&QUOT;的Vlink = QUOT;#00FF00&QUOT;&GT;


如果指定一种颜色,则应全部指定。在上面的

示例中,您的文本和链接颜色将显示在浏览器的默认

背景中,这可能无法提供足够的对比度。您也应该包括

BGCOLOR属性。

但是,我想将xhtml与css一起使用。


为什么选择XHTML?为什么不用带CSS的HTML?


另见 http://www.spartanicus.utvinternet.ie/no-xhtml.htm

在css文件中,我有下一行:
>身体{背景颜色:黑色; color:blue;}

定义通常文本和背景的颜色。你知道怎么一个人需要修改这一行来指定访问和活动链接的颜色吗?


a:link {background:black;颜色:白色;}

a:访问过{background:black;颜色:银色;}

a:主动{背景:黑色;颜色:红色;}


参见 http://www.w3.org/TR/CSS21/selector....pseudo-classes


我使用的是背景而不是背景颜色,因为使用背景

这样的快捷方式也将background-image属性设置为none。它b / b
有助于避免使用用户默认背景

图像的情况,而不是文档的背景颜色。


另外,你可能想查看一个好的CSS教程,例如
http://westciv.com/style_master/academy/css_tutorial/

另一个问题是,是否可以更改
链接中的文字颜色,还有链接的背景,即一个单词背后的背景或对应链接的
句子?
I know that in html to set colors of visited and activ links one need
to use line in the following format:

<BODY text="#FF0000" link="#0000FF" alink="#FFFF00" vlink="#00FF00">
If you specify one color, then you should specify them all. In the above
example, your text and link colors will show against the browser''s default
background, which may not provide sufficient contrast. You should include
the BGCOLOR attribute too.
However, I would like to use xhtml with css.
Why XHTML? Why not HTML with CSS?

See also http://www.spartanicus.utvinternet.ie/no-xhtml.htm
In css-file I have the next line:

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

which define color of usual text and background. Do you know how one
need to modify this line to specify colors of visited and active links?
a:link {background: black; color: white;}
a:visited {background: black; color: silver;}
a:active {background: black; color: red;}

See also http://www.w3.org/TR/CSS21/selector....pseudo-classes

I used background rather than background-color because using the background
shortcut like this also sets the background-image property to none. It
helps avoid the unlikely situation where the user''s default background
image is used, rather than the document''s background color.

Also, you might want to check out a good CSS tutorial, such as
http://westciv.com/style_master/academy/css_tutorial/
Another question is whether on can change not only colors of text in
link, but also background of link, i.e. background behind one word or
sentence which corespond to link?




当然。您可以使用链接伪类选择器设置您想要的任何

属性。

-

Darin McGrew, mc **** @ stanfordalumni.org http://www.rahul.net/mcgrew/

Web Design Group, da *** @ htmlhelp.com http://www.HTMLHelp.com /


墙上的字迹可能意味着您需要通过电话记事本。



Sure. You can use the link pseudo-class selectors to set whatever
properties you want.
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"The handwriting on the wall may mean you need a notepad by the phone."


op*********@yahoo.com 写道:
op*********@yahoo.com wrote:
我知道在html中设置访问和激活链接的颜色需要
使用以下格式的行:

< BODY text ="#FF0000" ;链接= QUOT;#0000FF&QUOT; ALINK = QUOT;#FFFF00&QUOT;的Vlink = QUOT;#00FF00&QUOT;&GT;


是的,这是90年代的做法。

但是,我想用ch使用xhtml。


为什么不用带CSS的HTML?使用XHTML的任何特殊原因,或者仅仅是个人喜欢的b / b $

在css文件中我有下一行:

body {background-颜色:黑色; color:blue;}

定义通常文本和背景的颜色。你知道怎么一个人需要修改这一行来指定访问和活动链接的颜色吗?


你没有。你设置链接的属性

本身,而不是身体。

a:link {color:#0000FF; background-color:#FFFFFF;}

a:visited {color:#00FF0; background-color:#FFFFFF;}

a:hover {color:#FFFF00; background-color:#FFFFFF;}

a:active {color:#FFFF00; background-color:#FFFFFF;}

另一个问题是,是否可以更改
链接中的文本颜色,还可以更改链接的背景,即一个单词背后的背景或
对应链接的句子?
I know that in html to set colors of visited and activ links one need
to use line in the following format:

<BODY text="#FF0000" link="#0000FF" alink="#FFFF00" vlink="#00FF00">
Yep that''s the 90s way of doing it.
However, I would like to use xhtml with css.
Why not HTML with CSS? Any particular reason to use XHTML, or just
personal fancy?
In css-file I have the next line:

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

which define color of usual text and background. Do you know how one
need to modify this line to specify colors of visited and active links?
You don''t. You set the properties of the links for the links
themselves, not for the body.
a:link {color: #0000FF; background-color: #FFFFFF;}
a:visited {color: #00FF0; background-color: #FFFFFF;}
a:hover {color: #FFFF00; background-color: #FFFFFF;}
a:active {color: #FFFF00; background-color: #FFFFFF;}
Another question is whether on can change not only colors of text in
link, but also background of link, i.e. background behind one word or
sentence which corespond to link?




与任何其他元素相同。

参见CSS规范: http://www.w3.org/tr/css21/


史蒂夫


-

我的理论给你起见,我的异端邪说你,

我永远不会回答信件,你不喜欢我的领带。 - 医生


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



Same as for any other element.
See the CSS spec: http://www.w3.org/tr/css21/

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