W3CastïŒ3ã§ã¯ãããã¹ïŒ CurlyBrace ïŒãã¹ã¿ã€ã«ã¬ã€ãã®äœ¿çšã«é¢ãããããã¯ã«è§Šãããã®ãããã¯ã«é¢ããèšäºãæ¢ã«æã£ãŠããŸããã ãã®ããããã¹ã¿ã€ã«ã¬ã€ããã®å¯èœæ§ã瀺ãèŠèŠçãªäŸã瀺ãããã«å
±æããããšã«ããŸãããã
ã¹ã¿ã€ã«ã¬ã€ã ãã¯ãéçºè
ã«ã³ãŒãæ§é ãšåãå
¥ããããèšèšã«ãŒã«ã«é¢ããæ
å ±ãæäŸããã«ãŒã«ãšèŠåã®ã»ããã§ãã ã»ãšãã©ã®å Žåããããžã§ã¯ãã«å
±ååå ããããã³ãŒãéçºã®èªå¶ã®ããã«ãéçºè
ã®ã°ã«ãŒãã䜿çšããŸãã
ãããžã§ã¯ãã倧ããå ŽåãããŸããŸãªé
è²ãã¿ã€ãã°ã©ãã£ãããã³ãã®ä»ã®ã¹ã¿ã€ã«èšå®ãåããå€æ°ã®
CSSãã¡ã€ã«ã«å²ãŸããŠããŸãã ã³ãŒãã®æ§é ã®æ··ä¹±ãé¿ããäœãã©ã®ããã«å¿ããªãããã«ããã«ã¯ãæ§é åã³ãŒããéçºããå¿
èŠããããŸããããã¯ãåŸã§ä»ã®ãããžã§ã¯ãã§äœ¿ãããããç·šéããéšåçã«äœ¿ãããããªããŸãã
æ確ãªã³ãŒããæŽçããæè¯ã®æ¹æ³ã¯ãã³ã¡ã³ãã䜿çšããããšã§ãã éçºè
ã¯ãã³ãŒãã®ç解ãæ¹åããããã«ãã³ã¡ã³ããšããã¹ã圢åŒã䜿çšããéåžžã«åµé çãªæ¹æ³ãæãã€ããŸããã ããªãã®å¥œã¿ã«åºã¥ããŠçµã¿åãããããšãã§ããå€ãã®ç°ãªãããªãã¯ããããŸãããä»ã®ãšãããããã®ã»ãã®ããã€ããæ€èšããŸãã
ãåå²ãšã«ãŒã«ã
ãŸããã¬ã€ã¢ãŠãã®æ§é ãåæãã
CSSã³ãŒãã§æãéèŠãªã³ã³ããŒãã³ãã匷調衚瀺ã
ãŸã ã ã»ãšãã©ã®å Žåãã¯ã©ã¹ãŸãã¯
CSSã»ã¬ã¯ã¿ãŒã§ãœãŒããããšäŸ¿å©ã§ãã ã³ãŒãã£ã³ã°ãéå§ããåã«ãèŠçŽ ãã°ã«ãŒãã«ã°ã«ãŒãåããŸãã ããšãã°ãã°ããŒãã«ã¹ã¿ã€ã«ïŒãæ¬æãã段èœããªã¹ããªã©ïŒãæ§é ãèŠåºããããã¹ãã¹ã¿ã€ã«ãããã²ãŒã·ã§ã³ããã©ãŒã ãã³ã¡ã³ããããã³åã
ã®èŠçŽ ã匷調衚瀺ã§ããŸãã
éèŠãªèŠçŽ ã匷調衚瀺ããããã«ãç¹å¥ãªã©ãã«ïŒãã¢ã¹ã¿ãªã¹ã¯ã-ã*ããŸãã¯ãã€ãã¹-ã-ããªã©ïŒãéžæããŸãã ããšãã°ãåã
ã®èŠçŽ ã°ã«ãŒãã®ããããŒã匷調衚瀺ã§ããŸãã ã³ãŒãããã°ããèŠããšãã¿ã°ãå°è±¡çã§ããããšãéåžžã«éèŠã§ãã
ãã ãããã®ã¢ãããŒãã¯ãã¡ã€ã³ã¹ã¿ã€ã«ã·ãŒããååã«å€§ãã倧èŠæš¡ãããžã§ã¯ãã§ã¯ããŸãå¹æçã§ã¯ãããŸããã ãã®å Žåãã¹ã¿ã€ã«ã¯è€æ°ã®ãã¡ã€ã«ã«åå²ã§ããåãã¡ã€ã«ã«ã¯åäžã®ã°ã«ãŒããå«ãŸããŸãã ãããè¡ãã«ã¯ãã¡ã€ã³ã¹ã¿ã€ã«ãã¡ã€ã«ã«ã°ã«ãŒãã¹ã¿ã€ã«ãã€ã³ããŒãããã ãã§ååã§ãã ãŸããããŒãžã«ã¯ã¡ã€ã³ãã¡ã€ã«ã®ã¿ãå«ããã ãã§ååã§ãã
<ã³ãŒãã¯ã©ã¹= "css">
/ *
---------------------------------------
[ãã¹ã¿ãŒã¹ã¿ã€ã«ã·ãŒã]
ãããžã§ã¯ãïŒObout.ru
ããŒãžã§ã³ïŒ1.1
æçµå€æŽïŒ05/06/08 [Floatã®ãã°ãAlexãä¿®æ£]
æ
åœïŒAlexandrïŒALexïŒãVasy PupkinïŒVPïŒ
äž»ãªçšéïŒOBOUT.RU
---------------------------------------
* /
@import "reset.css";
@import "layout.css";
@import "colors.css";
@import "typography.css";
@import "flash.css";
/ * @import "debugging.css"; * /
</ code>
ãŸããä»ã®éçºè
ãããââãžã§ã¯ãã«é¢ããè¿œå ã®æè¡æ
å ±ãç¥ã£ãŠãããšäŸ¿å©ã§ããååã®å€æŽå
容ããã€ã誰ãå€æŽããããªã©ã§ãã
ããã«ããããã°
CSSã¹ã¿ã€ã«ã®ãããã°ãæå¹ã«ããŠã誀ã£ãèŠçŽ ãèŠã€ããããšãã§ããŸãã
ç®æ¬¡ãäœæãã
ã³ãŒãã®æ§é ãèšè¿°ããããã«ãã¹ã¿ã€ã«ãã¡ã€ã«ã®å
é ã«å°ããªç®æ¬¡ãäœæã§ããŸãã ãã®ææ³ã¯ãããŒãžã®æ§é ããªãŒã®å¥ã
ã®ãã©ã³ããšããŠäœ¿çšãããèå¥åïŒIDïŒãšã¯ã©ã¹ïŒã¯ã©ã¹ïŒã䜿çšããŠãèŠçŽ ã®ã¬ã€ã¢ãŠãæ§é ã®æŠèŠãç°¡åã«äœæããã®ã«åœ¹ç«ã¡ãŸãã ããã§ã¯ãç¹å¥ãªããŒã¯ãŒãã䜿çšããŠãã³ãŒãå
ã®ç®çã®ã»ã¯ã·ã§ã³ãããè¿
éã«èŠã€ããããšãã§ããŸãã
ããšãã°ã次ã®ããã«ïŒ
<ã³ãŒãã¯ã©ã¹= "css">
/ *
---------------------------------------
[ã¬ã€ã¢ãŠã]
*äœ
+ããããŒ/ #header
+ã³ã³ãã³ã/ #content
-å·Šã®å/ #leftcolumn
-å³å/ #rightcolumn
-ãµã€ãããŒ/ #sidebar
-RSS / #rss
-æ€çŽ¢/ #search
-ããã¯ã¹/ .box
-ãµã€ãããã°/ #sideblog
+ããã¿ãŒ/ #footer
ããã²ãŒã·ã§ã³#navbar
åºå.ads
ã³ã³ãã³ãããããŒh2
---------------------------------------
* /
</ code>
ãŸãã¯ç§ãåºå®ãããã®ãããªãªãã·ã§ã³ïŒ
<ã³ãŒãã¯ã©ã¹= "css">
/ *
---------------------------------------
[ç®æ¬¡]
1.äœ
2.ããããŒ/ #header
2.1ã ããã²ãŒã·ã§ã³/ #navbar
3.ã³ã³ãã³ã/ #content
3.1ã å·Šã®å/ #leftcolumn
3.2ã å³å/ #rightcolumn
3.3ã ãµã€ãããŒ/ #sidebar
3.3.1ã RSS / #rss
3.3.2ã æ€çŽ¢/ #search
3.3.3ã ããã¯ã¹/ .box
3.3.4ã ãµã€ãããã°/ #sideblog
3.3.5ã åºå/ .ads
4.ããã¿ãŒ/ #footer
---------------------------------------
* /
</ code>
ã€ã³ããã¯ã¹ã§æ€çŽ¢ã§ããããŒãžã®æ§é ã®æŠç¥å³ãæäŸããŸãã
ãã¹ãã䜿çšãããéåžžã®çªå·ä»ããªã¹ãã䜿çšããããã«ç°¡åãªæ¹æ³ããããŸãã ã¹ã¿ã€ã«ã·ãŒãã§ãããã¯ãèŠã€ããã«ã¯ããã¡ã€ã«æ€çŽ¢ã䜿çšããŠããããã¯ã®çªå·ãŸãã¯ååãå
¥åããã ãã§ãã ãã®æ¹æ³ã¯éåžžã«ç°¡åãé«éãå¹ççã§ãã
<ã³ãŒãã¯ã©ã¹= "css">
/ *
---------------------------------------
[ç®æ¬¡]
1.äœ
2.ããããŒ/ #header
3.ããã²ãŒã·ã§ã³/ #navbar
4.ã³ã³ãã³ã/ #content
5.å·Šå/ #leftcolumn
6.å³å/ #rightcolumn
7.ãµã€ãããŒ/ #sidebar
8. RSS / #rss
9.æ€çŽ¢/ #search
10.ããã¯ã¹/ .box
11.ãµã€ãããã°/ #sideblog
12.åºå/ .ads
13.ããã¿ãŒ/ #footer
---------------------------------------
* /
<ïŒ-å€ãã®CSSã³ãŒãããããŸã->
/ *
---------------------------------------
[8ã RSS / #rss]
* /
#rss {...}
#rss img {...}
/ *
---------------------------------------
* /
</ code>
ç®æ¬¡ã䜿çšãããšãä»ã®éçºè
ã
CSSãç解ããŠèªã¿ããããªããŸãã ã³ãŒããèªããšãã«åžžã«ç®ã®åã«ããããã«å°å·ã§ããŸãã ããŒã ã¯ãŒã¯ã®å Žåãç®æ¬¡ã䜿çšããããšã¯å€§ããªå©ç¹ã§ãããæéãšååã®æéã倧å¹
ã«ç¯çŽã§ããŸãã
ããªã»ããã®é
è²ãšã¿ã€ãã°ã©ãã£
CSSã§å®æ°ãèšå®ããæ©èœããªãéããäžå€ã®ããããã£ããã°ãã衚瀺ããæ¹æ³ãæ¢ãå¿
èŠããããŸãã Webéçºã§ã¯ãå®æ°ã«ã¯ããã¥ã¡ã³ãã§äœ¿çšãããè²ãšã¿ã€ãã°ã©ãã£ãå«ãŸããŸãããããã¯åºå®å€ã§ãããããã¥ã¡ã³ãã§ç¹°ãè¿ã䜿çšãããŸãã
å®æ°ã®äžè¶³ã眮ãæãã1ã€ã®æ¹æ³ã¯ã䜿çšãããããã€ãã®å®æ°ã®å®çŸ©ãäœæããããšã§ãã ç¹°ãè¿ããŸãããããã¯ãããããããã£ããå¥ã®ããããã£ã«ã³ããŒãããšãã®æ··ä¹±ãé¿ããã®ã«åœ¹ç«ã¡ãŸãã ã¹ã¿ã€ã«ã·ãŒãã®ããããã£ãå€æŽããããšã«ããå Žåã¯ããšãã£ã¿ãŒã®æ€çŽ¢ããŒã«ãšçœ®æããŒã«ãå床䜿çšããŸãã
<ã³ãŒãã¯ã©ã¹= "css">
/ *
---------------------------------------
ïŒ[ã«ã©ãŒã³ãŒã]
ïŒããŒã¯ã°ã¬ãŒïŒããã¹ãïŒïŒïŒ333333
ïŒããŒã¯ãã«ãŒïŒèŠåºãããªã³ã¯ïŒïŒ000066
ïŒããããã«ãŒïŒããããŒïŒïŒ333399
ïŒæ°Žè²ïŒãããããã²ãŒã·ã§ã³ïŒ#CCCCFF
ïŒãããã°ã¬ãŒïŒïŒ666666
ïŒ
* /
</ code>
ãŸãã¯ãã¬ã€ã¢ãŠãã§äœ¿çšãããã«ã©ãŒã³ãŒããèšè¿°ããããšãã§ããŸãã åè²ã«ã€ããŠãããã䜿çšããã»ã¯ã·ã§ã³ãèšå®ã§ããŸããéãåæ§ã§ããã»ã¯ã·ã§ã³ã«ã€ããŠã¯ã䜿çšããè²ãèšå®ããŸãã
<ã³ãŒãã¯ã©ã¹= "css">
/ *
---------------------------------------
[ã«ã©ãŒã³ãŒã]
èæ¯ïŒ#ffffffïŒçœïŒ
å
容ïŒïŒ1e1e1eïŒã©ã€ããã©ãã¯ïŒ
ããããŒh1ïŒïŒ9caa3bïŒç·ïŒ
ããããŒh2ïŒïŒee4117ïŒèµ€ïŒ
ããã¿ãŒïŒïŒb5cedeïŒæ¿ãé»ïŒ
aïŒæšæºïŒïŒïŒ0040b6ïŒæ¿ãéïŒ
aïŒèšªåïŒïŒïŒ5999deïŒæ°Žè²ïŒ
aïŒã¢ã¯ãã£ãïŒïŒïŒcc0000ïŒãã³ã¯ïŒ
---------------------------------------
* /
</ code>
åãã¢ãããŒãã䜿çšããŠãã¿ã€ãã°ã©ãã£ãåç
§ããããšãã§ããŸãã
<ã³ãŒãã¯ã©ã¹= "css">
/ *
---------------------------------------
[ã¿ã€ãã°ã©ãã£]
æ¬æã³ããŒïŒ1.2em / 1.6em VerdanaãHelveticaãArialãGenevaãsans-serif;
ããããŒïŒ2.7em / 1.3em HelveticaãArialããLucida Sans UnicodeããVerdanaãsans-serif;
å
¥åãããã¹ããšãªã¢ïŒ1.1em HelveticaãVerdanaãGenevaãArialãsans-serif;
ãµã€ãããŒã®èŠåºãïŒ1.5em HelveticaãTrebuchet MSãArialãsans-serifã
泚ïŒåŸç¶ã®èŠåºãã¬ãã«ããšã«èŠåºãã0.4emãã€æžãããŸã
---------------------------------------
* /
</ code>
CSSããããã£ã®äžŠã¹æ¿ã
ããæ§é åãããçŽæçãª
CSSãäœæããããã®ã³ããããã€ããããŸãã éçºè
ã«ãã£ãŠçºæãããå€ãã®ãœãŒãæ¹æ³ããããŸãã äžéšã®éçºè
ã¯ãè²ãšãã©ã³ããæåã«é
眮ããããšã奜ã¿ãŸãã ä»ã®èŠçŽ ã¯ãèŠçŽ ã®é
眮ã«é¢é£ããããããã£ãªã©ãããéèŠãªããããã£ãæåã«é
眮ããããšã奜ã¿ãŸãã äžéšã®èŠçŽ ã¯ãæ§é ã¬ã€ã¢ãŠããŸãã¯ããããžã¬ã€ã¢ãŠãã«åŸã£ãŠãœãŒããããããšããããããŸãã ãã®ã¢ãããŒãã«ã¯ãã¿ã°ã»ã¬ã¯ã¿ãŒã®ã°ã«ãŒãåãå«ãŸããŸãã
<ã³ãŒãã¯ã©ã¹= "css">
äœ
h1ãh2ãh3ã
pãulãliã
ãã©ãŒã {
ããŒããŒïŒ0;
ããŒãžã³ïŒ0;
ããã£ã³ã°ïŒ0;
}
</ code>
äžéšã®éçºè
ã¯ãããããã£ãã¢ã«ãã¡ãããé ã«äžŠã¹æ¿ããããšã奜ã¿ãŸãã
<code class = "css"> body {backgroundïŒ#fdfdfd; è²ïŒïŒ333; ãã©ã³ããµã€ãºïŒ1em; è¡ã®é«ãïŒ1.4; ããŒãžã³ïŒ0; ããã£ã³ã°ïŒ0; } </ code>
ã©ãã§ãæžåŒèšå®ã¹ã¿ã€ã«ã䜿çšãããšãååã¯ããªãã®äœæ¥ã«æè¬ããŸããååããã®æžåŒèšå®ã¹ã¿ã€ã«ãé å®ããŸãã
ãã¹ãã£ã³ã°ã¯ããªãã®åéã§ãïŒ
衚圢åŒã®ã»ã¬ã¯ã¿ãŒã䜿çšãããšãã³ãŒããç解ãããããªããŸãã èŠçŽ ãæ·±ããªãã»ã©ãããå€ãã®ã¿ãããã®åã«é
眮ãããŸãã ã芪ãèŠçŽ ãå®çŸ©ãããåããç®çã®æ°ã®ãã¿ããã§åºåããŸãã
<ã³ãŒãã¯ã©ã¹= "css">
ïŒã¡ã€ã³å{衚瀺ïŒã€ã³ã©ã€ã³; floatïŒå·Š; å¹
ïŒ30em; }
ïŒmain-column h1 {font-familyïŒGeorgiaã "Times New Roman"; äœçœïŒ20ãã¯ã»ã«; }
ïŒã¡ã€ã³åp {è²ïŒïŒ333; }
</ code>
ãã¿ãããšã³ã¡ã³ãã䜿çšããå¥ã®èå³æ·±ãã¢ãããŒãããããŸãã æã
ãå€æŽãå ãããšãçµæãæåŸ
ãããã®ãšç°ãªãããšããããŸãã ããããå€ãã®å€æŽãè¡ããããããã®ãã¹ãŠãèšæ¶ã§ããªãå Žåã¯ã©ãã§ããããïŒ ããã¯ãCSSã³ãŒãã®æè¿ã®å€æŽã匷調衚瀺ããã®ã«åœ¹ç«ã€å ŽåããããŸãã è¡ãããå€æŽã¯è¿œå ã®ã€ã³ãã³ãã§ããŒã¯ã§ããŸããããã«ãããåãã»ã¬ã¯ã¿ãŒå
ã®ä»ã®ããããã£ãšåºå¥ãããŸãã ãŸãã¯ãã³ã¡ã³ãã§ããã€ãã®ããŒã¯ãŒãã䜿çšã§ããŸãã ããšãã°ã
@newã䜿çšãããšãåé¡ãèŠã€ãããŸã§å€æŽãç°¡åã«èŠã€ããŠããŒã«ããã¯ã§ããŸãã
<ã³ãŒãã¯ã©ã¹= "css">
#sidebar ul li a {
ãã£ã¹ãã¬ã€ïŒãããã¯;
èæ¯è²ïŒ#ccc;
border-bottomïŒ1px solidïŒ999; / * @new * /
ããŒãžã³ïŒ3px 0 3px 0;
ããã£ã³ã°ïŒ3px; / * @new * /
}
</ code>
ãããã«
CSSã¹ã¿ã€ã«ã¬ã€ãã¯ãé©åã«äœ¿çšãããšäŸ¿å©ã§ãã ãã¹ã¿ã€ã«ã¬ã€ããã䜿çšããŠãã³ãŒãã®ç解ãæ·±ããæ§é åãããã³ãŒããç解ã§ããªãå Žåã¯äœ¿çšããªãã§ãã ããã ããªãã®ç®æšã¯ãã³ãŒãã®ããè¯ãç解/èªã¿ããããéæããããšã§ãã
PSã éå°ãªããŒã¿ã®è»¢éã§ãŠãŒã¶ãŒã«è² æ
ããããªãããã«ãæçµããŒãžã§ã³ïŒãŸãã¯ããããã¯ã·ã§ã³ããšåŒã°ããïŒã«ãã¹ã¿ã€ã«ã¬ã€ããã®ã³ã¡ã³ããå«ããªãããšãå¿ããªãã§ãã ããã ãŸããéçºãå®äºããåŸããéçºè
ã¯ãã«ããŒãžã§ã³ã䜿çšããå¿
èŠããããŸãã
CSSã¹ã¿ã€ã«ã¬ã€ãã«ããã³ãŒãã®èªã¿ãããã®
åäžã«åºã¥ãç¡æ
翻蚳 ©
PPS ããŒãå¥ããã°ã«ç§»è¡ãããã«ã«ããæèµ·ãããã¹ãŠã®äººã«æè¬ããŸãã
UPDã ã³ã¡ã³ãã§ã
vithar ã¯åœŒã®CSSã³ãŒãã¹ã¿ã€ã«ã
å
±æããŸããã
ä»ã®äººãåå ããŠããã¹ããã©ã¯ãã£ã¹ãå
±æããããšããå§ãããŸãã
UPDã ã³ã¡ã³ãã§ãç§ã¯ãã§ã«phpdocãšã®é¡æšããããã¡ã€ã«ããä»ã§ã¯å
±éã®
cssdocæšæºã®å®è£
ã®å§ãŸãã«
åºäŒããŸãã-phpdocã®é¡äŒŒç©ã§ããããã§ã«cssã®ããã§ãã ãããžã§ã¯ãã®éçºã¯ãCSSã®éçºã«ãããŠã»ãŒäžå®ã®æšæºãéçºããã®ã«åœ¹ç«ã¡ãŸãã