关于css的问题,ul li的属性设置。

来源:百度知道 编辑:UC知道 时间:2024/05/21 21:09:46
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
body{
background-color:#ffdee0;
}
#list{
font-family:Arial, Helvetica, sans-serif;
height:30px;
overflow:visible;
}
#list ul{
list-style-type:none;
margin:0;
padding:0;
}
#list li{
float:left;
}
#list li a{
display:block; /* 区块显示 */
padding:3px 6px 3px 6px;
text-decoration:none;
border:1px solid #711515;
margin:2px;
width:50px;
}
#list li a:link,#list li a:visited{
background-color:#c11136;

给list制定个宽度就可以

#list{
font-family:Arial, Helvetica, sans-serif;
height:30px;
overflow:visible;
width: 1000px;
}

解决方案之一:
层 list :设置固定的宽度(足够所有的Li元素在一行显示即可。)

给li设个高度

dfd