日期:2014-05-16 浏览次数:20834 次
<style>
ul
{
list-style-type: none;
}
li
{
float: left;
display: inline-block;
display: -moz-inline-stack;
display: inline;
}
</style>
<div style="width: 500px; margin: auto; border: 1px solid red; overflow: hidden;
line-height: 30px; height: 30px;">
<span style="float: left"><</span>
<ul>
<li>1111111111111111111</li>
<li>22222222222222</li>
<li>33333333333333333333</li>
<li>444444444</li>
</ul>
<span style="float: right">></span>
</div>
<!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>无标题文档</title>
<style>
ul{margin:0;padding:0;}
li{list-style:none;}
.box{width: 500px; margin: auto; border: 1px solid red; overflow: hidden;line-height: 30px; height: 30px; position:relative;}
.box ul li{float:left;display:inline; vertical-align:top;height:30px;line-height:30px;padding:0 5px;}
.box ul {position: absolute;}
.box span{float:left;height:100%;line-height:30px;font-size:16px;background:#ccc;width:30px;text-align:center;}
.menu{float:left; width:440px;overflow:hidden; height:30px; position:relative;}
</style>
<script>
window.onload=function(){
var oBox=document.getElementById('box');
var aSpan=oBox.getElementsByTagName('span');
var oMenu=oBox.getElementsByTagName('div')[0];
var oUl=oMenu.getElementsByTagName('ul')[0];