Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

CssÊý¾Ýͼ±í


Data visualization is mostly achieved with flash applications or
with help of some programming languages. Are those solutions the only
way to present, let's say simple data chart? How about giving it a try
with nothing but good ol' css?
Take a look at the Demo
| Download Css Chart
Approach
In this example I am not using JavaScript or any backend application. All I rely on is well formed markup and css.
So, the goal is to present data chart. We could say that a chart is a
two dimensional object. So, the best structural and semantical choice
is definition list. Why? Well, for starter, it is a list of items.
Although the list is linear, we could interpret definition titles (dt
elements) as items on x axis and definition descriptions (dd elements)
as values on y axis.
If that doesn't make sense because of my poor explanation skills :) what I'll do here is turn this:
into this
with css alone.
The markup
In my example I have used a period of last 12 days and presented my working energy level in percentages,
100% being the best I've felt about working ever. As you can see, on 6th day it went up a bit because I
received a solid paycheck and that boosted me up :)
Anyway, to structure this kind of data I chose definition list. Definition title contains the day title
<dt>Day 1</dt>
And definition description contains the value
<dd>36</dd>
Inside the definition description element I will add a span and nested em element. Not for structural purposes,
but to give myself enough elements to work with. I will also assign classes that I can use later on.
So definition description looks like this now:
<dd><span class="type2 p80"><em>80</em></span></dd>
Styling it
Definition list contains acts as a chart container, so I'll assign background image to it and set the width and
height to match the dimension of the chart. Also, I'll remove default margins and paddings
dl#csschart


Ïà¹ØÎĵµ£º

IE6 IE7 IE8 FFä¯ÀÀÆ÷µÄCSS¼æÈÝÎÊÌâ(ת)

IE6¡¢IE7¡¢IE8¡¢FFä¯ÀÀÆ÷µÄCSS¼æÈÝÎÊÌ⣬±¾À´ie6¸úffÖ®¼äµÄ¼æÈÝÊǺÜÈÝÒ×½â¾öµÄ¡£¼ÓÉϸöie7»áÂé·³µã£¬ie8µÄ³öÏ־͸üÍ·ÌÛÁË£¬Ô­À´hack ie7µÄ·½·¨ÓÖ²»ÄÜÓÃÁË£¬Ôõô°ìÄØ£¿
»¹ºÃ£¬Î¢ÈíÌṩÁËÕâÑùÒ»¸ö´úÂ룺 °ÑÕâ¶Î´úÂë·Åµ½ÀïÃ棬ÔÚie8ÀïÃæµÄÒ³Ãæ½âÎöÆðÀ´¾Í¸úie7һģһÑùµÄÁË£¬ËùÒÔ£¬»ù±¾ÉÏ¿ÉÒÔÎÞÊÓie8£¬Ê£ÏµĴúÂëÖ»ÐèÒªÕâÑùд¾ ......

Ц̸IEϵÁÐ6.0µ½8.0ÍøÕ¾CSS¼æÈÝ

·½·¨³¬¼¶¼òµ¥Èý¾ä»°£º
µÚÒ»£º×öÍøÕ¾ÓÃIE7.0£¬Õâ¸ö°æ±¾ÊÇ×î±ê×¼µÄ°æ±¾¡£ÏȲ»Òª¹Ü±ðµÄä¯ÀÀÆ÷ÊÇ·ñ¼æÈÝ¡£
µÚ¶þ£ºÍøÕ¾×öÍ꣬ºÃÁËÓÃIE6.0£¬IE8.0²âÊÔһϣ¬ºÃÁË£¬IE6.0ÓÐС²¿·Ö±ä¶¯£¬IE8.0²ÒÄ¿È˶ã¬ÏÖÔÚÏÈÀ´½â¾öIE6.0µÄÎÊÌâ
         IE6.0ÊÇÏÖÔÚ×îÀÃ×îÀ¬»øµÄä¯ÀÀÆ÷°æ±¾£¬o(︶ ......

ÓÃCSSʵÏÖGridView±íÍ·¹Ì¶¨

ʵÏÖGridview±íÍ·¹Ì¶¨¿ÉÒÔͨ¹ýCSSÀ´ÊµÏÖ
 
½«GridView·Å½øÒ»¸öPanelÖУ¬È»ºóÉèÖÃPanel¿ÉÒÔÓÐÊú¹ö¶¯Ìõ(²Î¼ûÎÒµÄÁíһƪΪGridviewÉú³É¹ö¶¯Ìõ)¡£ÉèÖÃGridviewµÄStyleΪ<HeaderStyle CssClass="GridViewHeader" />
 
.GridViewHeader {
    position:relative ;
    tabl ......

css+divºÍtable+cssµÄ±È½Ï

css+divºÍtable+cssµÄ±È½Ï
 
¡¡CSS£«DIVÊÇÍøÕ¾±ê×¼£¨»ò³Æ“WEB±ê×¼”£©Öг£ÓõÄÊõÓïÖ®Ò»£¬Í¨³£ÎªÁË˵Ã÷ÓëHTMLÍøÒ³Éè¼ÆÓïÑÔÖеıí¸ñ£¨table£©¶¨Î»·½Ê½µÄÇø±ð£¬ÒòΪXHTMLÍøÕ¾Éè¼Æ±ê×¼ÖУ¬²»ÔÙʹÓñí¸ñ¶¨Î»¼¼Êõ£¬¶øÊDzÉÓÃcss+divµÄ·½Ê½ÊµÏÖ¸÷ÖÖ¶¨Î»¡£
 
CSS£«DIVÍøÕ¾Éè¼ÆµÄÓÅÊÆ
 
Ê×ÏÈ£¬CSSµÄ ......

CSSÖ®¹¤×÷ð¤Ìù

/* Cascading Style Sheet for IE4.01 last updated 10-16-97 */
DIV {COLOR: #333333; FONT-FAMILY: "ËÎÌå", "Arial", "Tahoma"; FONT-SIZE: 9pt}
P {COLOR: #333333; FONT-FAMILY: "ËÎÌå", "Arial", "Tahoma"; FONT-SIZE: 9pt}
TD {COLOR: #333333; FONT-FAMILY: "ËÎÌå", "Arial", "Tahoma"; FONT-SIZE: 9pt}
BODY {C ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ