首页 > 开发 > CSS > 正文

ie6不支持两个连续并列class类名怎么解决

2024-07-11 08:36:03
字体:
来源:转载
供稿:网友

代码如下:
HTML code:


<!doctype html>
<html>
<head>
<meta charset=”gb2312″ />
<title></title>
<style>
.i1 { font-size:21px; }
.i2 { font-size:121px; }
.i1.on { color:red; }
.i2.on { color:blue; }
</style>
</head>
<body>
<span class=”i1 on”>我的颜色 有问题?</span>
<span class=”i2″>我是垫背的</span>
</body>
</html>

在ff中是红色,没问题,这就是想要的效果,但是在ie6中却是蓝色,求解,不改变结构,有办法解决吗?
解决的完解代码如下:
HTML code:


<!doctype html>
<html>
<head>
<meta charset=”gb2312″ />
<title></title>
<style>
.i1 { font-size:21px; }
.i2 { font-size:121px; }
.i1 .on { color:red; }
.i2 .on { color:blue; }
</style>
</head>
<body>
<span class=”i1″><span class=”on”>我的颜色 有问题?</span></span>
<span class=”i2″><span class=”on”>我是垫背的</span></span>
</body>
</html>

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表