锘??xml version="1.0" encoding="utf-8" standalone="yes"?>精品久久久久久综合日本,久久国产精品99精品国产,亚洲成人久久久http://www.aygfsteel.com/SunRiver/category/44307.htmlTopics about Java SE, Servlet/JSP, JDBC, MultiThread, UML, Design Pattern, CSS, JavaScript, Maven, JBoss, Tomcat, ...zh-cnTue, 16 Mar 2010 02:30:15 GMTTue, 16 Mar 2010 02:30:15 GMT60Difference between class and id in CSShttp://www.aygfsteel.com/SunRiver/archive/2010/03/16/315552.htmlSun RiverSun RiverTue, 16 Mar 2010 02:14:00 GMThttp://www.aygfsteel.com/SunRiver/archive/2010/03/16/315552.html---The key thing to know is that IDs identify a specific element and therefore must be unique on the page – you can only use a specific ID once per document. Many browsers do not enforce this rule but it is a basic rule of HTML/XHTML and should be observed. Classes mark elements as members of a group and can be used multiple times, so if you want to define a style which will be applied to multiple elements you should use a class instead.

 Notice that an ID's CSS is an HTML element, followed by a "#", and finally ID's name. The end result looks something like "element#idname". Also, be sure to absorb the fact that when an ID is used in HTML, we must use "id=name" instead of "class=name" to reference it!

Why Did They Choose Those Names??

       ID = A person's Identification (ID) is unique to one person.

       Class = There are many people in a class.

ID for Layout and Uniqueness

Standards specify that any given ID name can only be referenced once within a page or document. From our experience, IDs are most commonly used correctly in CSS layouts. This makes sense because there are usually only one menu per page, one banner, and usually only one content pane.

In Tizag.com CSS Layout Examples we have used IDs for the unique items mentioned above. View the CSS Code for our first layout example. Below are the unique IDs in our code.

*       Menu - div#menuPane

*       Content - div#content

Answer: Classes vs IDs

Use IDs when there is only one occurence per page. Use classes when there are one or more occurences per page.



Sun River 2010-03-16 10:14 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 那曲县| 秦安县| 玛纳斯县| 镇赉县| 左权县| 北安市| 宜都市| 两当县| 连云港市| 蒙自县| 常州市| 平定县| 宣武区| 宜城市| 锡林郭勒盟| 德令哈市| 石河子市| 广宁县| 两当县| 洛阳市| 阳原县| 历史| 临西县| 巫溪县| 岢岚县| 景德镇市| 托克托县| 独山县| 开化县| 改则县| 仙居县| 马山县| 林西县| 庄浪县| 余干县| 东至县| 大冶市| 醴陵市| 永吉县| 二手房| 九龙坡区|