首页 >

css中怎么设置ul |Songericsson

css color contrast,免费css3,web网页css编写网页,css3 wifi 动画,css里面搜索框怎么打,css设置图片位置底端开头,Songericssoncss中怎么设置ul |Songericsson
ul {
list-style: none; /*去掉ul前面的默认符号*/
margin: 0;
padding: 0;
}
ul li {
padding: 10px; /*设置每个li的内边距*/
border-bottom: 1px solid #ccc; /*设置每个li的下边框*/
}
ul li:last-child {
border-bottom: none; /*去掉最后一个li的下边框*/
}
ul li a {
text-decoration: none; /*去掉a标签的下划线*/
color: #333; /*设置字体颜色*/
display: block; /*将a标签转换为块级元素,使它充满整个li的区域*/
}
ul li a:hover {
background-color: #f4f4f4; /*鼠标悬停时改变背景颜色*/
}

解释:

大家首先设置ul的样式,去掉ul前面的默认符号,并且把ul的外边距和内边距都设为0。接着,大家为ul中的每个li元素设定样式,给它们添加内边距和下边框,并且去掉最后一个li的下边框。大家让li内的a标签转换为块级元素,使它充满整个li的区域。然后大家为a标签添加样式,去掉下划线并且设置字体颜色。最后,大家在鼠标悬停时改变li的背景颜色。


css中怎么设置ul |Songericsson
  • css怎么制作卡片 |css style 居中
  • css怎么制作卡片 |css style 居中 | css怎么制作卡片 |css style 居中 ...

    css中怎么设置ul |Songericsson
  • css如何保存文件 |清楚小圆点的css
  • css如何保存文件 |清楚小圆点的css | css如何保存文件 |清楚小圆点的css ...

    css中怎么设置ul |Songericsson
  • css3三角形多步骤 |css处理元字符
  • css3三角形多步骤 |css处理元字符 | css3三角形多步骤 |css处理元字符 ...