基本的CSS问题重新具体化
嗨 -
我正在通过这本书开始,通过
Simon Collison开始CSS Web开发。我在第17-18页(第2章)遇到了问题,我已经复制并输入了三个规则的ID和< ptag。
第一个和第二个第二段是红色,第三段
应为
深灰色。我的问题是所有三段都是红色的。
以下是三条CSS规则:
p {
颜色:#F00 ;
}
/ *定义突出显示的文字* /
------------- -------------------------------------------------- -
#highlight {
颜色:#F00;
}
/ *定义默认文字* /
-------------------------------------- ---------------------------
#default {
color#333;
}
你能告诉我我做错了什么导致第三段
>
红色而不是深灰色?
我写信给作者,他告诉我,
中有一个错误的例子(没有足够的特异性),并且CSS规则应该是
读取:
/ *仅为框类中的段落设置文本红色* /
#container .box p {
颜色:#F00;
}
我试过了,它仍然不适合我。你能告诉我
我做错了什么,以及如何纠正它?
谢谢。
Hi--
I''m working my way through the book, Beginning CSS Web Development by
Simon Collison. I ran into a problem on pages 17-18 (Chapter 2), I
have copied and put in three rules re IDs and the <ptag.
The first and second paragraphs are red, and the third paragraph
should be
dark gray. My problem is that all three paragraphs are red.
Here are the three CSS rules:
p {
color: #F00;
}
/* Define highlighted text */
-----------------------------------------------------------------
#highlight {
color: #F00;
}
/* Define default text */
-----------------------------------------------------------------
#default {
color #333;
}
Can you tell me what I''m doing wrong which causes the third paragraph
to be
red instead of dark gray?
I wrote to the author, and he told me that there had been a mistake in
the example (not enough specificity), and that the CSS rule should
read:
/* Make text red only for paragraphs within the box class */
#container .box p {
color: #F00;
}
I have tried that, and it still doesn''t work for me. Can you tell me
what I''m doing wrong, and how to correct it?
Thank you.
pa ******* *****@gmail.com 写道:
pa************@gmail.com wrote:
[...]
/ *定义默认文字* /
----------------------------------------- ------------------------
#default {
color#333;
}
你能告诉我我做错了导致第三段
是红色而不是深灰色吗?
[...]
/* Define default text */
-----------------------------------------------------------------
#default {
color #333;
}
Can you tell me what I''m doing wrong which causes the third paragraph
to be red instead of dark gray?
否。您还没有提供URL(首选)甚至任何HTML代码。
我现在可以猜到是你的--------------线条搞乱了你真正的CSS。而且,这是星期二。这个东西永远不会在周二工作。
这是在所有浏览器中吗?
-
John
No. You haven''t provided a URL (preferred) or even any HTML code.
All I can guess at for now is that your -------------- lines are messing
up your real CSS. Also, it''s Tuesday. This stuff never works on Tuesday.
And is this in all browsers?
--
John
pa ********* ***@gmail.com 写道:
>
以下是三条CSS规则:
>
Here are the three CSS rules:
您发布的代码段并没有提供足够的信息来确定'b
'正在发生什么。上传您的测试页并发布URL。
-
Berg
The code snippet you posted doesn''t give enough info to determine what''s
going on. Upload your test page and post the URL.
--
Berg
2月20日,上午10:53,Bergamot< berga ... @ visi.comwrote:
On Feb 20, 10:53 am, Bergamot <berga...@visi.comwrote:
paul.denlin ... @ gmail.com写道:
paul.denlin...@gmail.com wrote:
以下是三个CSS规则:
Here are the three CSS rules:
您发布的代码片段没有提供足够的信息来确定's
还在继续。上传您的测试页并发布URL。
-
Berg
The code snippet you posted doesn''t give enough info to determine what''s
going on. Upload your test page and post the URL.
--
Berg
Hi- -
我已将页面上传到 http://www.china-ready.com/colly/stylesheet.htm
CSS为http: www.china-ready.com/colly/style1.css 链接到
上面的HTML页面。
谢谢,
Paul
Hi--
I have uploaded the page to http://www.china-ready.com/colly/stylesheet.htm
The CSS is http:www.china-ready.com/colly/style1.css It is linked to
the HTML page above.
Thanks,
Paul