在一个容器中调用多个CSS样式(转载)

居然可以在一个容器中多次调用不同的class来进行css的设定,认真的test的下,发现在IE6,FIRE FOX,IE7都可以正常显示,是我孤陋寡闻,还是IE的bug

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html>
<head>
<title>CSS Test</title>
 <style type="text/css">
 p {
padding: 5px 5px 5px 5px ;
}
 p.one {
border: 1px solid black ;
}
 p.two {
background-color: gold ;
}
 /* —- 就是这个令人吃惊的—- */
p.one.two {
color: white ;
}
 </style>
</head>
<body>
 <p class="one">
Only One
</p>
 <p class="two">
Only two
</p>
 <p class="one two">
Both One And Two
</p>
 </body>
</html>

 

Advertisements

2 responses to this post.

  1. Posted by Shunz on 二月 29, 2008 at 8:13 上午

    岩屋兄,确实是你火星了,同时调用多个class,可复用样式

    回复

  2. Posted by 巴鲁 on 二月 29, 2008 at 8:32 上午

    地球是很危险的我回火星了,拜拜!

    回复

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: