您的位置:首页 > Web前端 > CSS

CSS实现柱状图其实很简单

2009-08-11 09:44 337 查看
仁兄司徒正美在这里提到了CSS实现柱状图的方法: /article/6948411.html

这里给出我的实现,其实没有那么复杂,请看代码

Code
<!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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: