我是新手,想在css中实现无序列表的横排。谢了!

html-css018

我是新手,想在css中实现无序列表的横排。谢了!,第1张

html中写:

<ul class="list">

<li tittle="">我是第一个</li>

<li tittle="">我是第二个</li>

<li tittle="">我是第三个</li>

<li tittle="">我是第四个</li>

</ul>

css中定义:

.list{ width:800pxmargin:0 auto}

.list li{ list-style:nonewidth:200pxheight:25pxline-height:25pxfloat:left}

或者直接在页面title下面写

<style type="text/css">

.list{ width:800pxmargin:0 auto}

.list li{ list-style:nonewidth:200pxheight:25pxline-height:25pxfloat:left}

</style>

实现的效果都一样

打字不易,请采纳

如果前三个 li 前面是用的背景图:background: url(1.gif) no-repeat

那么:background: url(1.gif) no-repeat 0 2px

上面在 background 上加两个参数0和2px,是背景图位移距离,0是左往有移距离,2px是上面往下移距离

或者 ico 是用 <img>插入的,建议你换成背景图,更合理,不想换的话,可以把图片上面加高,多留两三个空白像素

另外:这种图片应该用 gif 或 png 图片格式让背景透明,用 jpg 至少弄个背景色和背后黄色一样,不然露陷了不好看的说,骚年...

1.取消下划线:a{text-decoration:none}a:visited{text-decoration:none}a:hover{text-decoration:none}2.字体大小:body{font-size:14px}3.表格宽度和高度:定义表格宽度后,在表格内部定义属性:overflow:hidden打字不易,请采纳