div块怎么包不住ul
Java学者
2016-07-22 15:41
一个li下div块里有包了几个a标签已经设置了浮动,div块也设置了overflow属性,可是div只包住一个a,其他的都到下面去了源代码如下。
无标题文档body { font-family:宋体; font-size:16px; color:white; }
body,ul,li { margin:0; padding:0; }
li { list-style:none; }
a { text-decoration:none; }
#container { width:500px; margin:200px auto; }
#container #top { width:500px; height:30px; padding:4px 20px; background:#4a73ad; border:1px solid #94b5ce; border-radius:5px; }
#top .active { border-radius:5px; background:#94b5ce; }
#top li { height:30px; padding:0 26px; float:left; padding:0 6px; position:relative; }
#top li a { line-height:30px; color:white; padding:0 20px; }
#top span { float:right; line-height:30px; cursor:pointer; }
#top li .UL { position:absolute; top:40px; left:0; width:422px; height:20px; border:1px solid #000; border-radius:5px; padding:4px 22px; display:none; }
#top li .UL a { color:#215a94; margin:0 8px; float:left; font-size:12px; line-height:22px; }
#top li .UL a:hover { text-decoration:underline; }
#top li .UL strong { float:left; line-height:22px; color:#7b5ab5; }
#top li .clear { zoom:0; }
#top li .clear:after { content:''; display:block; clear:both; }
window.err= = function(){
var oTop = document.getElementById('top');
var aLi = oTop.getElementsByTagName('li');
for( var i=0;i
aLi[i].index = i;
fnLi(aLi[i]);
}
var timer = null;
var oldLi = null;
var oldDiv = null;
var aAlength = 0;
function fnLi( li ){
var oDiv = li.getElementsByTagName('div')[0];
var aA = oDiv.getElementsByTagName('a');
li.err= = function(){
oldDiv.style.display = 'none';
clearInterval( timer );
oDiv.style.display = 'block';
oldLi.className = '';
li.className = 'active';
};
li.err= = function(){
timer = setTimeout( function(){
oDiv.style.display = 'none';
},200 );
oldDiv = oDiv;
oldLi = this;
};
oDiv.onmuseover = function(){
clearInterval( timer );
oDiv.style.display = 'block';
};
oDiv.onmuseout = function(){
timer = setTimeout( function(){
oDiv.style.display = 'none';
},200 );
};
}
function show( div ){
clearInterval( timer );
div.style.display = 'block';
}
function hide( div ){
timer = setInterval( function(){
div.style.display = 'none';
},200 );
}
};
- 首页
最近更新|
活动|
报名试听|
学员反馈
- 关于我们
妙味讲师|
培训方式|
培训理念|
联系我们
- 作品
班固|
MATRTX|
留学E网|
ECMall
- 博客
JS教程|
弹出层效果|
3D桌面标签|
Windows计算器
更多>>