请看看区别

4 篇文章 0 订阅

把两段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>



评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值