把两段html分别在浏览器下看看有啥区别,怎么实现的?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Li 1</title>
<style type="text/css">
.footbox{text-align: center;position: absolute;top: 200px;height: auto;width: 100%;white-space: nowrap;margin: auto;list-style-type: none;z-index: 12;padding: 0px;}
.footbox>.num{ width:110px; height:30px; border-top:#ccc solid 6px; position:relative; list-style:none; cursor:pointer; display:inline-block; padding:0px; margin:0px; color:#FFF; text-shadow:1px 1px 3px rgba(0,0,0,1); float:none;}
.footbox>.num{ width:110px; height:30px; border-top:#ccc solid 6px; position:relative; list-style:none; cursor:pointer; display:inline-block; padding:0px; margin:0px; color:#FFF; text-shadow:1px 1px 3px rgba(0,0,0,1); float:none;}
.footbox>.num:hover{ border-color:#db7f04;}
.footbox>.numhover{border-color:#db7f04 !important;}
</style>
</head>
<body>
<ul class="footbox">
<li class="num">有吉奈生子</li>
<li class="num">有森玲香</li>
<li class="num numhover">雨宫优衣</li>
<li class="num">原千寻</li>
<li class="num">原史奈</li>
<li class="num">原田春奈</li>
</ul>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Li 2</title>
<style type="text/css">
.footbox{text-align: center;position: absolute;top: 200px;height: auto;width: 100%;white-space: nowrap;margin: auto;list-style-type: none;z-index: 12;padding: 0px;}
.footbox>.num{ width:110px; height:30px; border-top:#ccc solid 6px; position:relative; list-style:none; cursor:pointer; display:inline-block; padding:0px; margin:0px; color:#FFF; text-shadow:1px 1px 3px rgba(0,0,0,1); float:none;}
.footbox>.num:hover{ border-color:#db7f04;}
.footbox>.numhover{border-color:#db7f04 !important;}
</style>
</head>
<body>
<script type="text/javascript">
var i;
var len;
var nameArray;
var tmpLi;
var ulEl;
nameArray = ['有吉奈生子','有森玲香','雨宫优衣','原千寻','原史奈'];
len = nameArray.length;
ulEl = document.createElement('ul');
ulEl.className = 'footbox';
for (i = 0; i < len; i++) {
tmpLi = document.createElement('li');
tmpLi.innerHTML = nameArray[i];
if ( i == 2 ) {
tmpLi.className = 'num numhover';
} else {
tmpLi.className = 'num';
}
ulEl.appendChild(tmpLi);
}
document.body.appendChild(ulEl);
</script>
</body>
</html>