CSS中ul li错位

蔡志远
博客专家认证
2009-03-16 03:58:50
我实在是崩溃了,求大家帮助~

错位图如下



CSS如下

#letter {
width:512px;
height:223px;
}

#letter ul{
list-style-type:none;
display:inline;
margin:0; padding:0;
width: 512px;
}
#letter ul li a{
display:block;
width: 68px;
float: left;
background-color: #EBF1F1;
text-decoration: none;
font-size: 24px;
color: #421473;
height: 35px;
line-height: 35px;
border-top-width: 1px;
border-top-style: solid;
border-top-color: #C4D2DB;

text-align: center;
list-style-type: none;
background-repeat: no-repeat;

}
#letter ul li a:hover{
font-size: 24px;
float: left;
line-height: 35px;
text-decoration: none;
background-color: #FFCF31;
color: #421073;
border-top-width: 1px;
border-top-style: solid;
border-top-color: #C4D2DB;
font-weight: bold;
}



我要让这些字母横排,结果就这样了,求助了!!!
...全文
908 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
star19860411 2010-04-02
  • 打赏
  • 举报
回复
#letter ul li {float:left}不要对#letter ul li a定义向左浮动
ipqkviss_ling 2010-03-30
  • 打赏
  • 举报
回复
ul li 是可以给他设置 一下内联的,设置为inline就可以为一行了,
ouyangshixiong 2010-03-16
  • 打赏
  • 举报
回复
不要给li设置border。需要border效果给li内部元素(比如span)增加border。
不能贴图,效果就不贴了。

li {
list-style-image:none;
list-style-position:outside;
list-style-type:none;
float:left;
padding:0 10px 0 8px;
text-align:center;
}
ul {
line-height:200%;
font-size: 200%;
display:inline;
}
li span {
border : solid 1px #D8D8D8;
}
njujiangming 2010-03-16
  • 打赏
  • 举报
回复
不应该给a设置float吧,对li设置
dehyicy 2010-03-16
  • 打赏
  • 举报
回复
在 #letter ul{}中加入float:left;
bhbhxy 2009-03-16
  • 打赏
  • 举报
回复
#letter ul li {float:left}
不要对#letter ul li a定义向左浮动
焱悠 2009-03-16
  • 打赏
  • 举报
回复
不需要过多的包含符
#letter li{float:left;}即可
快乐无边 2009-03-16
  • 打赏
  • 举报
回复
#letter ul li {float:left} 对 li设置

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧