background-color:#777777无法使用CSS [英] background-color: #777777 not working in CSS

查看:273
本文介绍了background-color:#777777无法使用CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在HTML页面上声明时


< LINK href =" mycss.css"类型= QUOT;文本/ CSS" rel = stylesheet />

....

< BODY class = myclass>


in mycss.css


BODY {FONT-WEIGHT:bold; FONT-SIZE:12px; FONT-FAMILY:日内瓦Arial; background-image:url(images / back.jpg); }


BODY.myclass {FONT-WEIGHT:bold; FONT-SIZE:15px; FONT-FAMILY:日内瓦Arial; background-color:#777777; }

....


第二个声明中的背景颜色未被采用,但是正常颜色背景图像back.jpg用于背景。


如何将#777777作为背景颜色?


Kevin

When I declare on HTML page

<LINK href="mycss.css" type="text/css" rel=stylesheet />
....
<BODY class=myclass>

in mycss.css

BODY { FONT-WEIGHT: bold; FONT-SIZE: 12px; FONT-FAMILY: Arial, Geneva; background-image: url(images/back.jpg); }

BODY.myclass { FONT-WEIGHT: bold; FONT-SIZE: 15px; FONT-FAMILY: Arial, Geneva; background-color: #777777; }
....

the background-color in the second declaration is NOT taken but the "normal" background image back.jpg is used for the background.

How do I get #777777 as background-color ?

Kevin

推荐答案

Kevin Yu写道:
Kevin Yu wrote:
BODY {FONT-WEIGHT:bold; FONT-SIZE:12px; FONT-FAMILY:日内瓦Arial; background-image:url(images / back.jpg); }

BODY.myclass {FONT-WEIGHT:bold; FONT-SIZE:15px; FONT-FAMILY:日内瓦Arial; background-color:#777777; }
....

第二个声明中的背景颜色不是采用,而是正常。背景图像back.jpg用于背景。

如何将#777777作为背景颜色?
BODY { FONT-WEIGHT: bold; FONT-SIZE: 12px; FONT-FAMILY: Arial, Geneva; background-image: url(images/back.jpg); }

BODY.myclass { FONT-WEIGHT: bold; FONT-SIZE: 15px; FONT-FAMILY: Arial, Geneva; background-color: #777777; }
....

the background-color in the second declaration is NOT taken but the "normal" background image back.jpg is used for the background.

How do I get #777777 as background-color ?




背景图片被绘制在背景颜色之上。您可以

声明

背景图片无

for BODY.myclass

-

Johannes Koch

in te domine speravi;非永久性的东西。

(Te Deum,4美分。)



Background images are painted on top of the background color. You may
declare
background-image none
for BODY.myclass
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)


Kevin Yu写道:
Kevin Yu wrote:
身体{FONT-WEIGHT:大胆; FONT-SIZE:12px; FONT-FAMILY:Arial,
日内瓦; background-image:url(images / back.jpg); }

BODY.myclass {FONT-WEIGHT:bold; FONT-SIZE:15px; FONT-FAMILY:Arial,
日内瓦; background-color:#777777; } ...

第二个声明中的背景颜色未被采用,但
正常背景图像back.jpg用于背景。
BODY { FONT-WEIGHT: bold; FONT-SIZE: 12px; FONT-FAMILY: Arial,
Geneva; background-image: url(images/back.jpg); }

BODY.myclass { FONT-WEIGHT: bold; FONT-SIZE: 15px; FONT-FAMILY: Arial,
Geneva; background-color: #777777; } ...

the background-color in the second declaration is NOT taken but the
"normal" background image back.jpg is used for the background.




当然可以,但你指定的背景有两个属性:

image和颜色。当您指定这两个属性时,两个属性都应用

,图像被放置在背景上,背景颜色根据您的规格来确定。


尝试用''background''属性替换''background-color''和''background-image''属性

,然后再用第二个定义

背景应该优先。


-

Dylan Parry
http://webpageworkshop.co.uk - 免费网络教程和参考资料


''我是一个很小的大脑熊,长话打扰我。'' - AA Milne



Sure it is, but the background you are specifying has two properties:
image and color. As you are specifying both properties, both are applied
with the image being laid over a background that is colored according to
your specification.

Try replacing the ''background-color'' and ''background-image'' properties
with ''background'' properties instead, and then the second definition of
the background should take precedence.

--
Dylan Parry
http://webpageworkshop.co.uk - FREE Web tutorials and references

''I am a Bear of Very Little Brain, and long words bother me.'' -- A A Milne


ky ******* @ lycos.net (Kevin Yu)写道:
ky*******@lycos.net (Kevin Yu) wrote:
< BODY class = myclass>
<身体{FONT-WEIGHT:粗体; FONT-SIZE:12px; FONT-FAMILY:Arial,
日内瓦; background-image:url(images / back.jpg); }

BODY.myclass {FONT-WEIGHT:bold; FONT-SIZE:15px; FONT-FAMILY:Arial,
日内瓦; background-color:#777777; }

第二个声明中的背景颜色未被采用,但
正常背景图像back.jpg用于背景。

如何将#777777作为背景色?
<BODY class=myclass>

BODY { FONT-WEIGHT: bold; FONT-SIZE: 12px; FONT-FAMILY: Arial,
Geneva; background-image: url(images/back.jpg); }

BODY.myclass { FONT-WEIGHT: bold; FONT-SIZE: 15px; FONT-FAMILY: Arial,
Geneva; background-color: #777777; }

the background-color in the second declaration is NOT taken but the
"normal" background image back.jpg is used for the background.

How do I get #777777 as background-color ?




已经是。

你已经设置了背景颜色和背景图像。

背景颜色将在图像未加载时使用,或者在图像未显示的任何页面的任何部分使用(即如果你阻止

平铺)。


要消除第二种风格的背景图像,请将其更改为

body.myclass {background -image:无; background-color:#777777;}


设置字体大小(以像素为单位)是一个非常糟糕的主意。


Steve
< br $> b $ b -

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

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


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



It already is.
You''ve set both a background-color and a brackground-image. The
background-color will be used when the image doesn''t load or in any
parts of the page where the image doesn''t show (i.e. if you prevent
tiling).

To eliminate the background-image from the second style change it to
body.myclass {background-image: none; background-color: #777777;}

And setting font sizes in pixels is a really bad idea.

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


这篇关于background-color:#777777无法使用CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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