作家
登录

CSS 柱状图实现代码其实很简单

作者: 来源:www.28hudong.com 2012-11-19 22:32:06 阅读 我要评论

<!doctype html> <head> <style> ul.chart{padding:0;margin:0;list-style:none;border:1px #ccc solid;height:255px;font-size:9pt;background:#ddf3ff} ul.chart p{padding:0;margin:0} ul.chart .title{text-align:center;height:25px;line-height:25px;} ul.chart li{width:80px;float:left;padding:0;} ul.chart li:hover{background:#f7f7f7;} ul.chart .total{height:230px;position:relative;} ul.chart .percent{background:#f0f;width:20px;position:absolute;left:25px;bottom:0;} </style> </head> <body> <ul class=chart> <li><p class=title>最终幻想</p><div class=total><p class=percent style="height:50%;">50%</p></div></li> <li><p class=title>星之海样</p><div class=total><p class=percent style="height:10%;">10%</p></div></li> <li><p class=title>白骑士</p><div class=total><p class=percent style="height:70%;">70%</p></div></li> </ul> </body> 提示:您可以先修改部分代码再运行

  推荐阅读

  CSS padding属性定义边内补白

边框的里面可以有一层边内补白(padding),边内补白定义了边框与边框里面内容的距离. 边内补白分为上边内补白(top),下边内补白(bottom),左边内补白(left),右边内补白(right). 边内补白只有width一种属性. 相关教程>>>详细阅读


本文标题:CSS 柱状图实现代码其实很简单

地址:http://www.17bianji.com/kaifa2/CSS/16771.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)