CSS:列表项的一些操作
2016-02-03 10:14
656 查看
一、通过背景实现列表标记
缺点:因为图像是设置在背景中的,不一定会被打印出来。
解决方法:在打印样式表中声明正常的列表标记。或其他一些类似的方法。
html:
CSS:
显示效果:
[b]二、生成列表标记[/b]
优点:解决了上一个列表标记的缺点,会被打印出来。
缺点:因为图像是设置在背景中的,不一定会被打印出来。
解决方法:在打印样式表中声明正常的列表标记。或其他一些类似的方法。
html:
<ul class="starts"> <li><div> The Broncos, who landed in San Jose at 4:45 p.m. PT Sunday, are staying just down the street from Levi’s Stadium, and practicing 14 miles away at Stanford’s practice fields and Stanford Stadium, if desired. They will practice Wednesday, Thursday and Friday at Stanford, and have a walk-through practice on Saturday morning, 11 a.m., at Levi’s Stadium, as is their normal custom. They’ll meet the media at their hotel on Tuesday, Wednesday and Thursday mornings, then be cloistered after that until Sunday.</div></li> <li><div> The Broncos, who landed in San Jose at 4:45 p.m. PT Sunday, are staying just down the street from Levi’s Stadium, and practicing 14 miles away at Stanford’s practice fields and Stanford Stadium, if desired. They will practice Wednesday, Thursday and Friday at Stanford, and have a walk-through practice on Saturday morning, 11 a.m., at Levi’s Stadium, as is their normal custom. They’ll meet the media at their hotel on Tuesday, Wednesday and Thursday mornings, then be cloistered after that until Sunday.</div></li> <li><div> The Broncos, who landed in San Jose at 4:45 p.m. PT Sunday, are staying just down the street from Levi’s Stadium, and practicing 14 miles away at Stanford’s practice fields and Stanford Stadium, if desired. They will practice Wednesday, Thursday and Friday at Stanford, and have a walk-through practice on Saturday morning, 11 a.m., at Levi’s Stadium, as is their normal custom. They’ll meet the media at their hotel on Tuesday, Wednesday and Thursday mornings, then be cloistered after that until Sunday.</div></li> <li><div> The Broncos, who landed in San Jose at 4:45 p.m. PT Sunday, are staying just down the street from Levi’s Stadium, and practicing 14 miles away at Stanford’s practice fields and Stanford Stadium, if desired. They will practice Wednesday, Thursday and Friday at Stanford, and have a walk-through practice on Saturday morning, 11 a.m., at Levi’s Stadium, as is their normal custom. They’ll meet the media at their hotel on Tuesday, Wednesday and Thursday mornings, then be cloistered after that until Sunday. Solutions</div></li> <li><div> The Broncos, who landed in San Jose at 4:45 p.m. PT Sunday, are staying just down the street from Levi’s Stadium, and practicing 14 miles away at Stanford’s practice fields and Stanford Stadium, if desired. They will practice Wednesday, Thursday and Friday at Stanford, and have a walk-through practice on Saturday morning, 11 a.m., at Levi’s Stadium, as is their normal custom. They’ll meet the media at their hotel on Tuesday, Wednesday and Thursday mornings, then be cloistered after that until Sunday.</div></li> </ul>
CSS:
ul.starts { list-style: none; margin-left: -10px;/*根据需要调整位置*/ } ul.starts li { background: url(image/star_16px_1163400_easyicon.net.png) 0 0.1em no-repeat; padding-left: 16px; /*让文本右移一些*/ border-bottom: 1px solid black; /*加底线*/ } ul.starts div { color: black; }
显示效果:
[b]二、生成列表标记[/b]
优点:解决了上一个列表标记的缺点,会被打印出来。
<style type="text/css"> ul.starts li:before { content: url(star.png); margin-right: 8px; } ul.starts li { text-indent: -20px; list-style: none; } </style>
相关文章推荐
- 纯css实现扁平化360卫士logo demo
- IE 8 下面的垂直水平居中
- 个人笔记 css 03 设置表格显示外边框
- 网页设计中,相对路径与绝对路径的问题
- 2016/02/02 slicebox(css部分)
- 使用CSS实现鼠标悬停在一行上,显示某些元素
- IE10修改select样式
- 多屏复杂动画CSS技巧三则
- css+div 导航条如何横着放
- 纯css打造下拉菜单
- 纯css下拉
- css img换行之后有空隙
- 【CSS】CSS中继承性与层叠性
- 创建一个纯CSS下拉菜单
- sublime text3 安装less2css
- CSS绘制常见的几何图形
- CSS绘制常见的几何图形
- 网页性能管理详解(原作者: 阮一峰)
- 网页性能管理详解(原作者: 阮一峰)
- 网页性能管理详解(原作者: 阮一峰)