最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

英文教程:五種CSS選擇器類型

互聯(lián)網(wǎng)   發(fā)布時間:2009-04-02 19:33:30   作者:佚名   我要評論
網(wǎng)頁制作Webjx文章簡介:英文教程:五種CSS選擇器類型. CSScommandsareusuallygroupedinthecurlybracestomakeasetofrules.FollowingarethevariouswaysavailabletoattachthesesetofruleswithHTMLcode. Selector(insimplewords)mea

英文教程:五種CSS選擇器類型. CSScommandsareusuallygroupedinthecurlybracestomakeasetofrules.FollowingarethevariouswaysavailabletoattachthesesetofruleswithHTMLcode.
Selector(insimplewords)meanshowyounamethesesetofrules.
1CLASSSelectORS
ClassselectorsisthesimplestformofselectorswhereyouassignyourownmeaningfulnametothesetofCSSrules.Tocreateaclassselectoryousimplyneedtowritenameoftheclassfollowedbyaperiod.
(Aclassnamecannotstartwithanumberorasymbolasitisnotsupportedbyvariousbrowsers.)
Forexample,
p.big{font-weight:bold;font-size:12px;}
.center{text-align:center;}
AndthisHTML:
<pclass="big">Thisparagraphwillberenderedbold.www.fzitv.net</p>
Youcanapplymorethanoneclasstoagivenelement.
AndthisHTML:
<pclass="centerbig">Thisparagraphwillberenderedbold.</p>
Intheaboveexample.bigand.centerarenameofCSSclassesandtheseclassesareappliedtoPtaginHTML.
IfclassnameisfollowedbyHTMLelementinyourCSScodelikep.biginaboveexampleitmeansthatthisclasswillworkonPtagonly.
OtherwiseyoucanapplytheCSSclassonanyelement.
It’sagoodpracticetoaddHTMLelementbeforeclassnameinCSSifyouarewritingCSSrulesforaparticularelement(ItaddsmoreclaritytoCSScode.
2IDSelectORS
IDselectorsworklikeclassselectors,exceptthattheycanonlybeusedononeelementperpagebecausetheyworkwithIDofthehtmlelement.TheidselectorisdefinedasidoftheHTMLelementfollowedbya#symbol.
Forexample,
p#navigation{width:12em;color:#666;font-weight:bold;}
AndthisHTML:
<pid="navigation">Thisparagraphwillberenderedbold.www.fzitv.net</p>
AsagoodpracticeIDselectorsmustbeusedifyouarewritingtheCSScodeforasingleHTMLelementonly.IDselectorsarewellsupportedacrossstandards-compliantbrowsers.
3TAGSelectOR
TagselectorisanothersimplemethodofCSSrulesimplementation.YoucanusethisselectortoredefinetherulesforaparticularHTMLelement.
Forexample:
p{color:#999;font-weight:bold;}
IntheaboveexampleCSScodewillbeautomaticallyappliedoneveryptag.
4DESCENDENTSelectORS
Descendentselectorsspecifythatstylesshouldonlybeappliedwhentheelementinquestionisadescendent(forexample,achild,oragrandchild)ofanotherelement.
Forexample,
h3em{color:white;background-color:black;}
AndthisHTML:
<h3>Thisis<em>emphasized</em>www.fzitv.net</h3>
Intheaboveexampleemisdescendentofh3element.Abovecssrulewillautomaticallybeappliedonallemelementsinsideh3elementintheHTMLcode.Descendentselectorsarewellsupportedacrossstandards-compliantbrowsers.
5GROUPINGSelectORS
Youcanalsospecifythesamesetofrulesformorethanoneselctor,likethis:
p,h1,h2{text-align:left;}
Justplaceacommabetweeneachone.
Youcanevengetmorecomplex,andgroupmultipleclassandidselectors:
p.navigation,h1#title{font-weight:bold;}

相關(guān)文章

  • 該不該使用ID選擇器?淺談對CSS的ID選擇器的使用建議

    在不嵌套單獨使用ID選擇器的情況下,它是比較快的,然而各種各樣的原因使開發(fā)者們拋棄對ID選擇器的使用.究竟該不該使用ID選擇器?這里我們就來淺談對CSS的ID選擇器的使用建議
    2016-07-11
  • 簡要講解CSS中的類型選擇器、ID選擇器、類選擇器

    這篇文章主要介紹了CSS中的類型選擇器和ID選擇器以及類選擇器,選擇器時CSS入門學習中的基礎(chǔ)知識,需要的朋友可以參考下
    2016-02-18
  • IE7對css選擇器的改進-CSS教程-網(wǎng)頁制作-網(wǎng)頁教學網(wǎng)

    1、對偽類的支持。IE6和更低的版本對于偽類的支持僅限于a標簽,諸如“:hover”、“:active”、“:focus”之類的偽類理論上是應該適用于所有
    2008-10-17
  • CSS屬性選擇器的四種格式-CSS教程-網(wǎng)頁制作-網(wǎng)頁教學網(wǎng)

      屬性選擇器(AttributeSelectors),或許你不應該對屬性選擇器感到陌生,從本質(zhì)上說,id跟類選擇器其實就是屬性選擇器,只不過是選擇了id或者類的值(value)而已。  
    2008-10-17
  • 最常用的五類CSS選擇器-CSS教程-網(wǎng)頁制作-網(wǎng)頁教學網(wǎng)

     一些新手朋友對選擇器一知半解,不知道在什么情況下運用什么樣的選擇器,這是一個比較頭疼的問題,針對新手朋友,對CSS選擇器作一些簡單的說明,希望能對大家的學習工作
    2008-10-17
  • 四種css 偽類選擇器

    偽類,用于給元素的片段添加樣式,這如何理解呢?比如你要讓一個段落的第一行的文字加粗,那么這個選擇器是不二之選
    2012-04-18
  • CSS3 選擇器 偽類選擇器介紹

    前面花了兩節(jié)內(nèi)容分別在《CSS3選擇器——基本選擇器》和《CSS3選擇器——屬性選擇器》介紹了CSS3選擇器中的基本選擇器和屬性選擇器使用方法,今天要和大家一起學習CSS3選擇
    2012-01-21
  • CSS3 選擇器 屬性選擇器介紹

    上一切在《CSS3選擇器——基本選擇器》中主要介紹了CSS3選擇器的第一部分,這節(jié)主要和大家一起來學習CSS3選擇器的第二部分——屬性選擇器
    2012-01-21
  • CSS3 選擇器 基本選擇器介紹

    CSS的選擇器,我想大家并不會陌生吧,因為天天在使用,但對于CSS3的選擇器,要運用的靈活到位,我想對很多朋友還是一定的難度,特別是CSS3中的:nth選擇器
    2012-01-21
  • 你不可不知的CSS選擇器

    *通配符選擇器,經(jīng)常用于css reset(樣式重置),清理標簽的默認樣式,但現(xiàn)在一般不提倡直接使用*了,主要是*會匹配所有標簽,相當耗資源。*在css的優(yōu)先級中是最低的。
    2011-07-27

最新評論

乡城县| 洛浦县| 公主岭市| 班戈县| 大埔县| 礼泉县| 类乌齐县| 遂昌县| 米易县| 西乡县| 宾阳县| 鄂尔多斯市| 孟村| 新营市| 龙游县| 永德县| 宿松县| 岳池县| 嘉鱼县| 资源县| 古蔺县| 永州市| 永仁县| 庐江县| 屯留县| 静海县| 寿阳县| 沐川县| 平罗县| 拜泉县| 台湾省| 文水县| 武冈市| 崇信县| 廊坊市| 镇坪县| 红安县| 仲巴县| 仙游县| 云南省| 宿松县|