关于DIV+CSS的 超级简单问题谢谢

来源:百度知道 编辑:UC知道 时间:2024/05/23 19:17:12
怎么写能使 .other_left 和 .other_right 都能使用UL?

回答完全正确再加30分!

.other_left ul {
margin: 0;
padding: 3px 4px 8px 8px;
list-style: none;
}

.other_right ul {
margin: 0;
padding: 3px 4px 8px 8px;
list-style: none;
}
必须这2个DIV,因为下面有对应的DIV other_left和other_RIGHT 不同的哦
<div class="other_left">
<h6>测试</h6>
<ul><li>测试</li>
</ul>
</div>

<div class="other_right">
<h6>测试</h6>
<ul><li>测试</li>
</ul>
</div>
或者怎么写能更简单些?

可否这样写:
.other_left ul .other_right {
margin: 0;
padding: 3px 4px 8px 8px;
list-style: none;
}
这样写了,是不是.other_left 和 .other_right 都能使用UL?如果不能如何能啊?谢谢,回答完全正确再加30分!
.other_left ul .other_right ul
这样写不可以啊,忘了说了 .other_left和.other_right 唯一的区别就是.other_left 多一个 clear:left;

div 里有个class
ul{
....

}
<div class="ul 其它的css"></div>

这里不是可以用了呀

//////////////////这样不是又可以了呀

当然可以这么写了,那就是CSS级联嘛!

看到你的left 和right都是一样的!用.other_left ul .other_right{}这样写是可以的!!它们的属性完全一样,如果你想不一样,你就分开喽!!呵呵!建意分开!!呵呵!!

.other_left ul .other_right ul {
margin: 0;
padding: 3px 4px 8px 8px;
list-style: none;
}

也可以:
ul {
margin: 0;
padding: 3px 4px 8px 8px;
list-style: none;
}