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>
这里给出我的实现,其实没有那么复杂,请看代码
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>
相关文章推荐
- CSS 柱状图实现代码其实很简单
- Html+css实现柱状图
- table、div+css实现的柱状图表
- 简单实现验证码随机数(其实原理很简单就是一堆图片,然后点击随机改变图片的src属性)
- 实现掘金导航栏+float按钮其实可以很简单
- css---用UL标签实现的柱状图
- 基于CSS的柱状图实现
- 用css实现柱状图,要求DOM不一样
- Android 弹幕的实现其实很简单
- 基于CSS的柱状图实现
- css实现柱状图
- 实现botNet,其实很简单
- 约瑟夫环问题的讨论 具体的实现代码;其实很简单。
- 实现了hibernate的简单的分页了。其实很简单(一)
- 基于CSS的柱状图实现
- 纯CSS实现美观大方的网页柱状图效果
- 其实实现梦想很简单,不要放弃不要迷茫
- 实现了hibernate的简单的分页了。其实很简单(二)
- div+css实现软件公司网站蓝色导航菜单代码
- wp7里实现饼状统计图 柱状图 曲线图