CSS问题!
我现在实现了css的层级显示/隐藏。可是不太完美,实际需要一层一层的展开,可以一次隐藏多层下属。 而我所实现的是一次全部展开,一次可隐藏多层下属。
请高手帮忙改一下。
多谢啦。
代码如下:
PHP code:
<script language="JavaScript">
function toggle(id) {
var state = document.getElementById(id).style.display;
if (state == 'block') {
document.getElementById(id).style.display = 'none';
} else {
document.getElementById(id).style.display = 'block';
}
}
</script>
<style type="text/css">
#main{
position:relative;
top:20px;
left:20px;
width:200px;
background: lightblue;
}
#hidden {
position:relative;
top:0px;
left:280px;
width:200px;
background: lightgrey;
display: none;
}
#hidden2 {
position:relative;
top:-20px;
left:580px;
width:200px;
background: lightgreen;
display: none;
}
#hidden3 {
position:relative;
top:100px;
left:0px;
width:200px;
background: lightpink;
display: none;
}
</style>
<div id="main" onclick="toggle('hidden');toggle('hidden2');toggle('hidden3');">
1
</div>
<div id="hidden" onclick="toggl
相关问答:
CSS code:
body {
}
#x
{
width:1024px;
height:768%;
background-color:Red;
position:relative;
}
#x.top
{ position:absolute;
width:800px;
height:100px;
top:0px ......
<div style ="width:538px; height:150px; border:solid 1px gray; padding:10px;">
<div style =" width:230px; height:150px; float ......
用vc 读取html文件怎么得到css里面定义的字体样式。比如我网页的一段代码为:
<style type="text/css">
<!--
.STYLE7 {font-weight: bold; font-family: "宋体"; color: #F ......
请问为什么火狐很多时候都会变形呢
比方这个.proc { width:680px; height:auto; float:left; clear:both;}
在IE里面如果有的图片是 700px的宽,那么会自动的缩小
可是在火狐里面 就自动放大了,width ......