上午使用我的李项目的css。CSS李的背景宽度
div.categories li.selected
{
background-color:#d6d6d6;
white-space: nowrap;
list-style-type: square;
padding-right: 5px;
padding-left: 5px;
margin-left: 0px;
margin-bottom: 0px;
margin-right: 0px;
white-space: nowrap;
line-height: 20px;
width: 50px;
}
的问题是在锂的项目的内容的宽度不断变化,但根据Li的含量我不能改变的背景的宽度。如果我保持宽度不变,问题如下所示,否则,如果我不保持固定宽度,背景会延伸到最后。
CSS背景不舒展,悲伤。 – Blender
'ul'有宽度吗? – Chris
@Chris - 在图像中是 –