CSSªºcontentÄÝ©Ê

¤j®a¦n¡I³o¦¸·Q¨Ó©M¤j®a°Q½×CSSªºcontentÄÝ©Ê¡C[1]

³oÄݩʦU¦ìÀ³¸Ó¤£­¯¥Í¡A´N¬O®M¥Î¦b°°Ãþ¡u:before¡v¡B¡u:after¡v¤W²£¥Í¤º®e¡C¦ýW3C¤å¥ó¤W¨Ã¨S¦³©ú½T»¡©ú¡A²£¥ÍªºÄÝ©Ê¥i§_¥[¨ìDOM¤W¡C¤@¯ë¨Ó»¡¡ACSS¬O¥Î¨Óºûôºô­¶¥~Æ[ªº¡A¥Í¦¨ªº¤º®e»P¤å¥ó¥»¨­À³¬O¤ÀÂ÷ªº¡A¤]¤£¸Ó±N¤å¥ó¥»¨­¤£¥i¤À³Îªº¤º®e¥ÎCSS§e²{¡]¦p¸Ë¹¢¥Îªº¹Ï®×¥Î­I´º¡B©IÀ³¤º¤åªÌ¥Î¤¸¯À<img>¡^¡C

©M¨ä¥¦CSSÄݩʤ£¦P¡Acontent¥i¥H¼W¥[¡u¤å¦r¡v¡B¡uHTMLÄÝ©Ê­È¡v¡A¬Æ¦Ü¬O¡u§Ç¸¹¡v¨ìºô­¶¤W¡A§Ú­Ì¥i¥H»´©ö¦aÅܧócontentªº­È¥H²Å¦X·í«eªº·ÑÅé§ÎºA¡Bª©­±­·®æ¡B»yºØ¡C¦ý¤£¥i§_»{¦a¡Acontent¤S©M¤å¥ó¦³µÛÃø¥H¤À¶}ªºÃö«Y¡A¥Bcontent¤@µü¥»¨­´N¥]§t¤F¡u¤º®e¡vªº·N«ä¡X¡X´N®³[1]¤¤ªº½d¨Ò¨Ó»¡§a¡A·í¨Ï¥ÎªÌ½Æ»scontent§@¥Îªº¤¸¯À®É¡A§Ú­Ì·|¹w´Ácontent¤¤ªº¤å¦r¤]¤@¨Ö½Æ»s¡A<q>¤¸¯Àªº¤Þ¸¹¡B<h2>«eªº¡uChapter. count(XX)¡v¡A©Î¬O¤¤¤åºô­¶¤¤¡A<cite>ªº®Ñ¦W¸¹µ¥µ¥¡C¦]¦¹§Ú»{¬°content²£¥Íªº¤å¦rÀ³¥[¨ìDOM¤W¡A©Î¦Ü¤ÖÅý¨Ï¥ÎªÌ±o¥H¡u½Æ»s¡v¡C

²{¦b¥u¦³Opera²Å¦X³o­Ó­n¨D¡A¨ä¥¦¦pGecko¡BWebkit½Æ»s®É³£¤£·|³s¦P½Æ»scontentªº¤º®e¡C¦]¦U®aÂsÄý¾¹¦³¤£¦Pªº¹ê§@¡A©Ò¥HÀ³¸Ó¥i¥H­n¨DW3C±N¡ucontent¬O§_±o¥H³Q½Æ»s¡v¼g¤J¼Ð·Ç¡A·íµM¤£¤@©w·|©M§Ú»¡ªº¤@¼Ë´N¬O¤F¡C

¤j®a¥i¥Hµ¹ÂI·N¨£¶Ü¡H


[1] http://www.w3.org/TR/CSS21/generate.html#content




Best Wishes,
Ethan

Mandarin: Chen Yijun
Hoklo: Tan I-kun
Cantonese: Can Jik-guan

http://ethantw.net/

http://twitter.com/ethantw/

Received on Monday, 30 May 2011 11:04:00 UTC