CSS 直方图布局示例
作者:bea
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>CSS直方图示例</title> <meta http-equiv="Content-Type" content="text/html; charset=gbk"> <style type="text/css"> .char
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>CSS直方图示例</title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<style type="text/css">
.chart {
font-family: Tahoma;
font-size: 12px;
border: 1px solid #ccc;
float: left;
margin: 0;
padding: .4em .1em;
}
.chart li {
list-style: none;
float: left;
width: 5em;
text-align: center;
background: url(/upload/2009-11/20091104144827988.gif) center 1.6em no-repeat;
}
.chart li span {
display: block;
text-indent: -999em;
padding-bottom: 90px;
background: url(/upload/2009-11/20091104144827692.gif) center -1px no-repeat;
border-top: 5px solid #fff;
}
.chart strong {
display: block;
text-align: center;
font-weight: normal;
}
</style>
</head>
<body>
<ul class="chart">
<li>一月<span style="background-position: center -35">: </span><strong>35%</strong></li>
<li>二月<span style="background-position: center -40">: </span><strong>40%</strong></li>
<li>三月<span style="background-position: center -87">: </span><strong>87%</strong></li>
<li>四月<span style="background-position: center -45">: </span><strong>45%</strong></li>
<li>五月<span style="background-position: center -23">: </span><strong>23%</strong></li>
</ul>
<p style="clear: both"></p><p> </p>
<ul class="chart">
<li><em>一月</em><span style="background-position: center -35">: </span><strong>35%</strong></li>
<li><em>二月</em><span style="background-position: center -40">: </span><strong>40%</strong></li>
<li><em>三月</em><span style="background-position: center -87">: </span><strong>87%</strong></li>
<li><em>四月</em><span style="background-position: center -45">: </span><strong>45%</strong></li>
<li><em>五月</em><span style="background-position: center -23">: </span><strong>23%</strong></li>
</ul>
<p style="clear: both"></p><p> </p>
</body>
</html>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行]
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- 表格 隔行换色升级版
- csdn 论坛技术区平均给分功能
- js 操作table之 移动TR位置 兼容FF 跟 IE
- 按键盘方向键翻页跳转的javascript代码(支持ie,firefox)
- 在js中单选框和复选框获取值的方式
- javascript 常见的闭包问题的解决办法
- 模仿JQuery sortable效果 代码有错但值得看看
- javaScript parseInt字符转化为数字函数使用小结
- jQuery toggle()设置CSS样式
- javascript 打印内容方法小结
- 兼容多浏览器的iframe自适应高度(ie8 、谷歌浏览器4.0和 firefox3.5.3)
- JavaScript 自动分号插入(JavaScript synat:auto semicolon insertion)
- jQuery 加上最后自己的验证
- javascript Math.random()随机数函数
- JavaScript 抽奖效果实现代码 数字跳动版
- jquery (show,fadeOut,Animate)简单效果
- jquery checkbox全选反选效果代码
- jquery animate 动画效果使用说明
- jquery 动态调整textarea高度