仓酷云

标题: 带来一篇三种CSS图表代码 [打印本页]

作者: 金色的骷髅    时间: 2015-1-16 00:17
标题: 带来一篇三种CSS图表代码
那么什么是Div+CSS标准?Div+CSS的标准化设计到底有什么好处?
这是最基础的预览,上面是几种分歧的使用代码
1、基础的CSS图表
CSS代码
<style>
.graph{
position:relative;/*IEisdumb*/
width:200px;
border:1pxsolid#B1D632;
padding:2px;
}
.graph.bar{
display:block;
position:relative;
background:#B1D632;
text-align:center;
color:#333;
height:2em;
line-height:2em;
}
.graph.barspan{position:absolute;left:1em;}
</style>
<divclass="graph">
<strongclass="bar"style="width:24%;">24%</strong>
</div>
2、庞大的CSS条形图
CSS代码
<style>
dl{
margin:0;
padding:0;
}
dt{
position:relative;/*IEisdumb*/
clear:both;
display:block;
float:left;
width:104px;
height:20px;
line-height:20px;
margin-right:17px;
font-size:.75em;
text-align:rightright;
}
dd{
position:relative;/*IEisdumb*/
display:block;
float:left;
width:197px;
height:20px;
margin:0015px;
background:url("g_colorbar.jpg");
}
*htmldd{float:none;}
/*IEisdumb;QuickIEhack,applyfavoritefiltermethodsfor
widerbrowsercompatibility*/

dddiv{
position:relative;
background:url("g_colorbar2.jpg");
height:20px;
width:75%;
text-align:rightright;
}
dddivstrong{
position:absolute;
rightright:-5px;
top:-2px;
display:block;
background:url("g_marker.gif");
height:24px;
width:9px;
text-align:left;
text-indent:-9999px;
overflow:hidden;
}
</style>
<dl>
<dt>LoveLife</dt>
<dd>
<divstyle="width:25%;"><strong>25%</strong></div>
</dd>
<dt>Education</dt>
<dd>
<divstyle="width:55%;"><strong>55%</strong></div>
</dd>
<dt>WarCraft3Rank</dt>
<dd>
<divstyle="width:75%;"><strong>75%</strong></div>
</dd>
</dl>
3、CSS竖条图
CSS代码
<style>
#vertgraph{
width:378px;
height:207px;
position:relative;
background:url("g_backbar.gif")no-repeat;
}
#vertgraphul{
width:378px;
height:207px;
margin:0;
padding:0;
}
#vertgraphulli{
position:absolute;
width:28px;
height:160px;
bottombottom:34px;
padding:0!important;
margin:0!important;
background:url("g_colorbar3.jpg")no-repeat!important;
text-align:center;
font-weight:bold;
color:white;
line-height:2.5em;
}

#vertgraphli.critical{left:24px;background-position:0px!important;}
#vertgraphli.high{left:101px;background-position:-28px!important;}
#vertgraphli.medium{left:176px;background-position:-56px!important;}
#vertgraphli.low{left:251px;background-position:-84px!important;}
#vertgraphli.info{left:327px;background-position:-112px!important;}
</style>
<divid="vertgraph">
<ul>
<liclass="critical"style="height:150px;">22</li>
<liclass="high"style="height:80px;">7</li>
<liclass="medium"style="height:50px;">3</li>
<liclass="low"style="height:90px;">8</li>
<liclass="info"style="height:40px;">2</li>
</ul>
</div>

CSS的极大优势表现在简洁的代码,对于一个大型网站来说,可以节省大量带宽,而且众所周知,搜索引擎喜欢清洁的代码。
作者: 精灵巫婆    时间: 2015-1-24 21:42
Dreamweaver是集网页制作和管理网站于一身的所见即所得网页编辑器,在编辑时能同时看到源码和设计界面,非常方便新手学习制作网页。
作者: 愤怒的大鸟    时间: 2015-2-2 14:57
技术的学习如同长跑。只要越过极限,就会越跑越轻松。技术的学习其实并不像想象中那么可怕,任何技术都并不高深莫测。
作者: 冷月葬花魂    时间: 2015-2-8 01:45
足见市场的反响和MACROMEDIA公司对它们的自信。说到Dreamweaver8我们应该了解一下网页编辑器的发展过程,随着互联网(Internet) 的家喻户晓。
作者: 柔情似水    时间: 2015-2-24 04:38
难以逾越的障碍会大大打击你的学习积极性。这就需要你的恒心,坚持不懈的决心。在自己无法解决某些问题时,就需要虚心请教别人.
作者: 莫相离    时间: 2015-3-7 11:04
足见市场的反响和MACROMEDIA公司对它们的自信。说到Dreamweaver8我们应该了解一下网页编辑器的发展过程,随着互联网(Internet) 的家喻户晓。
作者: 分手快乐    时间: 2015-3-15 04:15
Dreamweaver是唯一提供Roundtrip HTML、视觉化编辑与原始码编辑同步的设计工具。它包含HomeSite和BBEdit等主流文字编辑器。
作者: 飘飘悠悠    时间: 2015-3-21 20:41
Dreamweaver是唯一提供Roundtrip HTML、视觉化编辑与原始码编辑同步的设计工具。它包含HomeSite和BBEdit等主流文字编辑器。




欢迎光临 仓酷云 (http://www.ckuyun.com/) Powered by Discuz! X3.2