gpt4 book ai didi

html - 容器中带有 ul 的 IE7 CSS 问题

转载 作者:太空宇宙 更新时间:2023-11-04 00:19:16 26 4
gpt4 key购买 nike

我不太擅长调试 IE,因为...好吧,因为我讨厌它并且不想与它有任何关系 >_<

无论如何......我正在创建这个 TreeView 插件,一切看起来都很棒......

但是,出于某种原因,它在 IE7 中看起来完全乱七八糟,而且仅在 IE7 中(不知道 IE6 等,但说真的,搞砸了那 block #%/"#).

looks like this, piece of "%(!¤ IE... .

有谁知道如何修复它或为什么会这样?

Here's the generated html & css example


CSS

body{
margin: 0px;
padding: 0px;
}

.vbc-treeview{
font-family: Tahoma, Geneva, sans-serif;
font-size: 12px;
padding-left: 10px;
padding-top: 0px;
overflow: auto;

width: 200px;
height: 200px;

border: 1px solid #828790;
margin: 5px;

}

.vbc-treeview ul{
list-style-type: none;
margin: 0px;
margin-left: 20px;
margin-top: 0px;
padding: 0px;
position: relative;
}

.vbc-treeview ul:first-child{
margin-left: 10px;
}

.vbc-treeview li{
position: relative;
}

.vbc-treeview li:first-child{
padding-top: 0px !important;
}

.vbc-treeview li a{
text-decoration: none;
color: black;
display: block;
cursor: default;
line-height: 16px;
}

.vbc-treeview .tv-sibling{
position: absolute;
background-color: transparent;
background: url(http://img813.imageshack.us/img813/1664/connector.png);
}

.vbc-treeview .tv-sibling-horizontal{
left: -12px;
top: 8px;
background-repeat: repeat-x;
height: 1px;
width: 8px;
z-index: 0;
}

.vbc-treeview .tv-sibling-vertical{
left: -14px;
top: 0px;
background-repeat: repeat-y;
height: 100%;
width: 1px;
z-index: 0;
}

.vbc-treeview .tv-sibling-first{
top: 8px;
}

.vbc-treeview .tv-collapse{
position: absolute;
background: url(http://img825.imageshack.us/img825/2134/collapser.png) no-repeat center;
width: 9px;
height: 9px;
left: -18px;
top: 4px;
z-index: 1;
}

.vbc-treeview .tv-expanded{
background-position: 0px 0px;
}

.vbc-treeview .tv-collapsed{
background-position: -10px 0px;
}

HTML

<div class="tree vbc-treeview">
<ul>
<div class="tv-sibling tv-sibling-vertical tv-sibling-first" style="height: 609px;"></div>
<li class="tv-expanded">
<div class="tv-collapse tv-expanded"></div>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,2</a>
<ul>
<div class="tv-sibling tv-sibling-vertical" style="height: 41px;"></div>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,2,0</a>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,2,1</a>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,2,2</a>
</li>
</ul>
</li>
<li class="tv-expanded">
<div class="tv-collapse tv-expanded"></div>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node0</a>
<ul>
<div class="tv-sibling tv-sibling-vertical" style="height: 249px;"></div>
<li class="tv-expanded">
<div class="tv-collapse tv-expanded"></div>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,0</a>
<ul>
<div class="tv-sibling tv-sibling-vertical" style="height: 121px;"></div>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,0</a></li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,1</a></li>
<li class="tv-expanded">
<div class="tv-collapse tv-expanded"></div>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,2</a>
<ul>
<div class="tv-sibling tv-sibling-vertical" style="height: 57px;"></div>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,2,0</a>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,2,1</a>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,2,2</a>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,2,3</a>
</li>
</ul>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,3</a>
</li>
</ul>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,1</a>
</li>
<li class="tv-expanded">
<div class="tv-collapse tv-expanded"></div>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,2</a>
<ul>
<div class="tv-sibling tv-sibling-vertical" style="height: 57px;"></div>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,2,0</a>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,2,1</a>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,2,2</a>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,2,3</a>
</li>
</ul>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 0,3</a>
</li>
</ul>
</li>
<li class="tv-expanded"><div class="tv-collapse tv-expanded"></div><div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node1</a>
<ul><div class="tv-sibling tv-sibling-vertical" style="height: 25px;"></div>
<li><div class="tv-sibling tv-sibling-horizontal"></div><a href="#">Node 1,0</a></li>
<li><div class="tv-sibling tv-sibling-horizontal"></div><a href="#">Node 1,1</a></li>
</ul>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node2</a>
</li>
<li class="tv-expanded">
<div class="tv-collapse tv-expanded"></div>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node3</a>
<ul>
<div class="tv-sibling tv-sibling-vertical" style="height: 185px;"></div>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 3,0</a>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 3,1</a>
</li>
<li class="tv-expanded">
<div class="tv-collapse tv-expanded"></div>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 3,2</a>
<ul>
<div class="tv-sibling tv-sibling-vertical" style="height: 121px;"></div>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 3,2,0</a>
</li>
<li class="tv-expanded">
<div class="tv-collapse tv-expanded"></div>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 3,2,1</a>
<ul>
<div class="tv-sibling tv-sibling-vertical" style="height: 57px;"></div>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 3,2,1,0</a>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 3,2,1,1</a>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 3,2,1,2</a>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 3,2,1,3</a>
</li>
</ul>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 3,2,2</a>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 3,2,3</a>
</li>
</ul>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node 3,3</a>
</li>
</ul>
</li>
<li>
<div class="tv-sibling tv-sibling-horizontal"></div>
<a href="#">Node4</a>
</li>
</ul>
</div>

最佳答案

尝试在父 div 上添加 position:relative

关于html - 容器中带有 ul 的 IE7 CSS 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9965570/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com