Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use pure CSS to realize the effect of beautiful and generous web page bar chart

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

小编给大家分享一下怎么用纯CSS实现美观大方的网页柱状图效果,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!

代码如下:

CSS柱状图

body {padding:0;margin:40px;font-size:9pt;font-family:Helvetica,Geneva,sans-serif;}

h4 {font-weight:normal;display:block;width:600px;text-align:center;}

ul#q-graph {

border:2px solid #0063be;

background:#adfe12 url(http://files.jb51.net/file_images/article/201505/2015512160152351.png) repeat-x scroll 0 0 !important;

background:#adfe12 repeat-x scroll 0 0;

height:300px !important;

height:304px;

width:600px;

position:relative;

list-style:none;

margin:1.1em 1em 3.5em;

padding:0;

}

#q-graph li {

position:absolute;

text-align:center;

bottom:0;

padding:0

margin:0;

}

li.qtr {

width:150px;

height:300px;

border-right:1px dotted #41a3e2;

z-index:2;

}

li#q1 {left:0;}

li#q2 {left:150px;}

li#q3 {left:300px;}

li#q4 {left:450px;border-right:none;}

#q-graph ul {list-style:none;}

li.bar {

width:34px;

color:#fff;

}

li.north {

left:36px;

background:#ddd url(http://files.jb51.net/file_images/article/201505/2015512155936873.gif) no-repeat 0 0;

}

li.south {

left:80px;

background:#ddd url(http://files.jb51.net/file_images/article/201505/2015512155936873.gif) no-repeat -34px 0;

}

li#ticks {

left:0;

height:300px;

width:100%;

z-index:1;

}

div.ticks {

position:relative;

height:60px;

border-top:1px dotted #41a3e2;

}

div.ticks:first-child {border-top:none;}

div.ticks p {

position:absolute;

left:103%;

top:-11pt;

}

Q1

20

11

Q2

50

39

Q3

48

26

Q4

36

22

60

37

32

19

看完了这篇文章,相信你对"怎么用纯CSS实现美观大方的网页柱状图效果"有了一定的了解,如果想了解更多相关知识,欢迎关注行业资讯频道,感谢各位的阅读!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report