ä»å¹Žã¯ããããã®ã³ã³ãã³ããæã€ãŠã§ããµã€ããåèšèšããŠããŸãã ã èšèšèŠä»¶ã¯åçŽã§ãããã¯ã©ã€ã¢ã³ãã¯ãæ¢åã®äŒç€Ÿã®ããŽãä¿æããå°å·å¯åºŠãåäžãããèªã¿ããããåäžãããããšãæ±ããŸããã ãã®ãããèšèšéçºã®æåã®æ®µéã§ãæ å ±ãããã¯ã®ã©ã€ãã©ãªçšã«é©åã«æ§æãããã°ãªãããèšç»ããã®ã«ããªãã®æéãè²»ãããŸããã
éå»æ°å¹Žã«ããã£ãŠããã®èãæ¹ã¯ããäžè¬çã«ãªããŸããã Mark BoultonãKhoi Vinhãããã³ãã®ä»ã®äººã ã®ãããã§ãå°å·ã°ãªãããžã®é¢å¿ãšããããäžã§ã®äœ¿çšæ¹æ³ãåã³æ³šç®ãããŠããŸãã ãããŠãççŽã«èšã£ãŠããã®ã¢ã€ãã¢ã¯é©ãã¹ããããã§ããïŒ æ°çŸäžã® CSS ãã¬ãŒã ã¯ãŒã¯ ãå€ãã®è£å®ç㪠ããŒã«ã§æ ã ããããããå¹³åçãªãã¶ã€ããŒ/ã¬ã€ã¢ãŠããã¶ã€ããŒãã°ãªããããŒã¹ã®ãã¶ã€ã³ã«ããã«ã¢ã¯ã»ã¹ã§ããããã«èšèšãããŸããã ãããŠããªãã§ããïŒ ã°ãªããã«ããŽãªã§æ°åéèããåŸãã¡ãªãããæããã«ãªããŸããèšèšè ã¯ãæ å ±æ§é ãæ§ç¯ããããã®åççã§æ§é åããããã¬ãŒã ã¯ãŒã¯ãååŸãããŠãŒã¶ãŒã¯ãæ§é åãããèªã¿ããããµã€ããååŸããŸãã
ãã®äžæ¹ã§ãã¯ã©ã€ã¢ã³ãã¯ããã«å¥ã®ãããèŽåœçãªèŠä»¶ãæ瀺ããŸããããã©ãŠã¶ãŒãŠã£ã³ããŠã«åãããŠããã¶ã€ã³ãæ¡å€§ããã³ãµã€ãºå€æŽããå¿ èŠããããŸãã éåžžãããã¯ç§ãéšã ãããããåãã§æ¥ãããããããŸãã ã©ããŒã¯ãWebãã¶ã€ã³ã®éå°è©äŸ¡ãããŠãããã©ãã€ã ã§ãã 圌女ã¯ããã¶ã€ã³ã®å¶åŸ¡ããŠãŒã¶ãŒã®æãšãŠã§ããµãŒãã£ã³ã®ç¿æ £ã«å§ããŠããŸã ã ãŸãããã®æ©èœã¯Webãã¶ã€ããŒã®æ³åãšã¯ãŸã£ããç°ãªããŸãã
æå°ç»é¢è§£å床ïŒå°ããªçœªã®ãªãåã
ããŽã ãã®çŸåŸ³ãæ¢ã代ããã«ãç§ãã¡ã¯ãæå°ç»é¢è§£å床ããšãããããã§çœªã®ãªãåã«é Œã£ãŠããŸãã ãããã®3ã€ã®åèªã«ã¯åŒ·åãªéæ³ãå«ãŸããŠããããã®ã«ããŒã®äžã«ãå¹ ãåºå®ããããã¶ã€ã³ã次ã ã«äœæããããããå®å šã«ãªããšæ°å¹Žããšã«ãã¶ã€ã³ã®å¹ ãå¢ããã ãã§ãã ãæå°ç»é¢è§£å床ãã«ããããŠãŒã¶ãŒã®éããããµãã»ããããç¥ãšPhotoshopãæå³ãããšããã«ãµã€ããèŠãããšãã§ããŸãã ãããã®ãŠãŒã¶ãŒã¯åžžã«ãã«ã¹ã¯ãªãŒã³ãã©ãŠã¶ãŒãŠã£ã³ããŠãš1024x768ã®è§£å床ã§ãµã€ããé²èŠ§ãã OLPCã©ãããããã4æ³ä»¥äžã®ã¢ãã¿ãŒã䜿çšããªãã§ãã ããã ãŠãŒã¶ãŒããæå°ç»é¢è§£å床ãã®èŠä»¶ãæºãããŠããªãå Žåã¯ãã¹ã¯ããŒã«ããŒããããŸããïŒ
ãã¡ãããç§ããµã€ããã³ãŒãã£ã³ã°ãããšããç§ã¯åºå®å¹ ã®èšèšã®æ¬ é¥ã«ã€ããŠå³ããéé£ã®ã¹ããŒããæžãèŽ æ²¢ãããŠããŸããã§ããã 代ããã«ãç§ã¯å·éãªäºå®ãæ®ããŸããã顧客ã®ã³ã³ãã³ãèŠæ±ãæºããããã«ååã«æŽç·Žãããã°ãªãããéçºããŠããéãã¯ã©ã€ã¢ã³ã-ãããŠãã¹ãŠã«å ããŠããŠãŒã¶ãŒ-ã¯ããŽã ããæãã§ããŸããã ãªã¹ãã§ããã»ãšãã©ãã¹ãŠã®ã°ãªããããŒã¹ã®ãã¶ã€ã³ã¯åºå®å¹ ã§ãããé£ãã質åãæ®ã£ãŠããŸããããŽã ã®äœãæ¹ã¯ïŒ
çµå±ã®ãšãããããã¯ã³ã³ããã¹ãã®åé¡ã«ãããŸããã
IEã«æ¬åœã«æè¬ãã¹ãã§ããïŒ
å æã§ããªãåé¡ã«çŽé¢ããŠãç§ã¯æåãå°œãããŸããïŒãããåé¿ããŸããã ã°ãªãããããŽã ãã®ããã«åäœãããããã®ãæ¹æ³ããšãã質åãäžæçã«èã«çœ®ããŠãç§ã¯ã§ããããšãããŸããããŸããè²ãšèæ¯ã®ã¹ã¿ã€ã«ã次ã«ãã©ã³ãã決å®ããŸããã
ãµã€ãºããã¯ã»ã«åäœã§æå®ãããŠããå Žåã¯ãIEã®ååã«ææžåããããã©ã³ããµã€ãºå€æŽã®åé¡ã«ã€ããŠæ¢ã«ç¥ã£ãŠãããããããŸãã ã ãžã§ãŒãžã¢ã§ã¯ãã©ã³ãã16ãã¯ã»ã«ã«èšå®ããŸãããŠãŒã¶ãŒãããã¹ãã®ãµã€ãºãã©ã®ããã«å¢æžããããšããŠããIEã§ã¯16ãã¯ã»ã«ã®ãŸãŸã«ãªããŸãã IE7以éã§ã¯ããŠãŒã¶ãŒã¯ããŒãžå šäœãæ¡å€§çž®å°ã§ããŸããããã¯ã»ã«åäœã§å®çŸ©ãããŠãããã©ã³ããµã€ãºãIEã§å€æŽããã ãã§ãã¿ããŒã®ãŸãŸã§ãã ãããã£ãŠããŠãŒã¶ãŒã«æè»æ§ãæãããããã«ãæšæºçãªèãæ¹ã®èšèšè ã¯ããã¯ã»ã«ãå®å šã«çããçžå¯Ÿçãªåäœã䜿çšããŠããã©ã³ãã ããŒã¯ãŒã ã ããŒã»ã³ããŒãžããŸãã¯ãæ°ã«å ¥ãã®emã決å®ããŸãã
emã®ããã«çžå¯Ÿçãªæž¬å®åäœã䜿çšããããšãããå Žåã¯ããã¹ãŠãã³ã³ããã¹ãå ã«ããããšãç解ã§ããŸããã€ãŸããemã®å®éã®ãµã€ãºã¯èŠªèŠçŽ ã®ãã©ã³ããµã€ãºã«å¯ŸããŠèšç®ãããŸãã ããšãã°ã次ã®ã¬ã€ã¢ãŠãã䜿çšãããšããŸãã
ãã¯ã»ã«ã䜿çšããŠããã¹ãã®ãµã€ãºãç°¡åã«æ±ºå®ããäŸã
é¢çœãããšã¯ãããŸããã段èœã¯16px HelveticaãšããŠå®çŸ©ãããŠããããœãŒããããŠããªããªã¹ãã¯14pxã«ãããã«åæžãããh1ã¯24px Georgiaã«å¢å ããŠããŸãã æ§çã«ïŒ ããïŒ
äºéã«ã»ã¯ã·ãŒãªã®ã¯ã1ã€ã®ç°¡åãªã«ãŒã«ã§ãã¹ãŠãäžåºŠã«ååŸã§ããããšã§ãã
- body {
- ãã©ã³ãïŒéåžžã®100ïŒ HelveticaãArialãsans-serifã
- }
ãã©ã³ããµã€ãºã100ïŒ ã®å ŽåãããŒãžäžã®ãã¹ãŠã®èŠçŽ ã®ãµã€ãºã¯ããã©ãŠã¶ãŒã®ããã©ã«ãã®ãã©ã³ããµã€ãºïŒã»ãšãã©ã®å Žå16pxïŒã«å¯ŸããŠæ±ºå®ãããŸãã ãã©ãŠã¶åœ¢åŒã®ããŒãã«ã®ãããã§ãh1ã¯å€§ããã倧èã§ãçŸããã§ãããããã§ãHelveticaã§å€§ããããŸãã åé¡ã解決ããããã«ãfont-familyã䜿çšããŠHelveticaãåé€ããã®ã¯éåžžã«ç°¡åã§ãããããã¹ãã®ãã©ã³ããµã€ãºã24pxã«å€æŽããæ¹æ³ã¯ãããŸããïŒ ãŸãã¯ããªã¹ãã®ãã©ã³ããµã€ãºãæ£ç¢ºã«çž®å°ããŸããïŒ
emã䜿çšãããšãããã¯ç°¡åã§ãã åèŠçŽ ã®ã¿ãŒã²ããfont-sizeå€ãååŸãããã®ã³ã³ãããŒïŒãããã³ã³ããã¹ãã§ãïŒã®ãã©ã³ããµã€ãºïŒfont-sizeïŒã§é€ç®ããŸãã ãã®çµæãçžå¯ŸçãªåäœïŒemïŒã§è¡šãããç®çã®ãã©ã³ããµã€ãºïŒfont-sizeïŒãååŸããŸãã ãŸãã¯ãèŠããã«ïŒ
target ÷ context = result
bodyã¿ã°ã®ãã©ã³ããµã€ãºãããã©ã«ãã§16pxã§ãããšä»®å®ãããšããã®åŒã§å¿ èŠãªfont-sizeå€ãèšè¿°ã§ããŸãã ãããã£ãŠãèšç®ã§å¿ èŠãªããããŒãµã€ãºãååŸããããã«ãã¿ãŒã²ããå€ïŒ24pxïŒãã³ã³ãããŒã®ãã©ã³ããµã€ãºïŒfont-sizeïŒïŒ16pxïŒã§é€ç®ããŸãã
24 ÷ 16 = 1.5
ã¿ã€ãã«ã¯æ¬æã®ãã©ã³ããµã€ãºã®1.5åãã€ãŸã1.5emã§ããããã®å€ãã¹ã¿ã€ã«ã·ãŒãã«è¿œå ã§ããŸãã
- h1 {
- ãã©ã³ããã¡ããªãŒïŒãžã§ãŒãžã¢å·ãã»ãªãã
- ãã©ã³ããµã€ãºïŒ1.5em; / * 24px / 16px = 1.5em * /
- }
ãªã¹ããµã€ãºã14pxã«çžåœããemã«å€æããã«ã¯ãåãåŒã䜿çšã§ããŸãã ãã©ã³ããµã€ãºïŒfont-sizeïŒãå³å¯ã«16pxã§ãããšä»®å®ãããšãã¿ãŒã²ããå€ããã®ã³ã³ããã¹ãã§åçŽã«åå²ããŸãã
14 ÷ 16 = 0.875
ãããŠãå€0.875emãååŸããŸãããããCSSã«å ¥åã§ããŸãã
- ul {
- ãã©ã³ããµã€ãºïŒ0.875em; / * 14px / 16px = 0.875em * /
- }
ããã2ã€ã®ã«ãŒã«ã«ããããµã³ãã«ããŒãžã¯èšç»ããããã®ã«éåžžã«è¿ããªãã ç°¡åãªè¿œå ã§ã»ãŒå®ç§ã«ãªããŸãã ãããŠãããããã¹ãŠã¯ããã©ãŒãã¥ã©
target ÷ context = result.
æ°æéãããŠãµã€ãºãããéããåŸãç§ã¯çãã«ã€ãŸãããŠããããšã«æ°ä»ããŸããã ãã©ã³ããµã€ãºããã¯ã»ã«ãšããŠã§ã¯ãªããã³ã³ããã«å¯ŸããŠèšç®ãããå²åãšããŠèããããšãã§ããå Žåãåãããšãä»ã®ã°ãªããèŠçŽ ã«é©çšã§ããŸãã
ãšã³ããšã³ãã§ã¯ãããã¯ããŽãŒã«ãã³ãã¯ã»ã«ãã§ã¯ãããŸãã
åãšåæ§ã«ãæ確ã§
åºæ¬çãªããŒã¯ã¢ãã
ãã¡ããã ç§ãã¡ã®ããã¶ã€ã³ãã¯æ§ããã§ãã ãã ããã·ã³ãã«ãªã¹ã¿ã€ã«ã¯æ確ã«å®çŸ©ãããã°ãªããã«éããããŸããããæ£ç¢ºã«ã¯ã20pxã®ç©ºçœã§åºåããããããã124pxã®7åã§ãå¹ ã¯ãã¹ãŠ988pxã§ãã ãããããããã®åä»ãªãã¯ã»ã«ã«ã€ããŠã¯å¿ããŸãããã å²åã¯ç§ãã¡ã®ãã¹ãŠã§ãããïŒ ãŽã ãããããã€ããŒïŒ
ãã®äžã«ã°ãªãããããåºæ¬ã¬ã€ã¢ãŠã
ãŸããã¬ã€ã¢ãŠããåºå®ãŸãã¯ã¹ãã¬ããã®ä»»æã®ã¬ã€ã¢ãŠããšèããŠã¿ãŸããããã³ãŒããæžãå§ããåã«ããã¶ã€ã³ãèŠãŠæ å ±ãããã¯ãå®çŸ©ããŸãããã 幞ããªããšã«ããããã®å€ãã¯ãããŸããã
æ å ±ãããã¯ãå®çŸ©ããŸãã
æäžäœã¬ãã«ã§ã¯ãããŒãžã®äžéšã«ã¿ã€ãã«ãããã6ã€ã®åã«ãŸãããæ å ±é åãšã巊端ã®åã«ããã€ãã®ç¶æ³äŸåæ å ±ããããŸãã ãã®ã¹ããŒã ãããæ§é ãšã»ãã³ãã£ã¯ã¹ã®äž¡æ¹ã®ç¹ã§æ å ±ã»ããã«å¯Ÿå¿ããããŒã¯ã¢ããã¹ã±ã«ãã³ãåºå¥ã§ããŸãã
- < div id = "page">
- < h1 >æ¯çé©åœã¯æŸæ ãããŸãã</ h1 >
- < div class = "entry">
- < h2 > Helveticaã«ããããããŠãã人ã¯ããŸããïŒ</ / h2 >
- < h3 class = "info"> A <a href = "#">ããã°</ a >ãšã³ããªïŒ</ h3 >
- < div class = "content">
- < div class = "main">
- < p >äž»ãªã³ã³ãã³ãã¯ãã¡ãã§ãã Lorem ipsumãªã©ãªã©</ P >
- </ div > <ïŒ-/ end .main->
- < div class = "meta">
- < p >ãªã©ã«æçš¿ããŸãã</ p >
- </ div > <ïŒ-/ end .meta->
- </ div > <ïŒ-/ end .content->
- </ div > <ïŒ-/ end .entry->
- </ div > <ïŒ-/ end #page->
ãããŠãããã€ãã®ã¿ã€ãã°ã©ãã£ã«ãŒã«ãé©çšãããšã ãŸãšããªåç §ãã€ã³ããåŸãããŸãã ãã ããã³ã³ããïŒ#pageïŒã«ã¯å¶éãå«ãŸããŠããªããããã³ã³ãã³ãã¯ãã©ãŠã¶ãŠã£ã³ããŠã®å¹ ã«å¯Ÿå¿ããããã«åœ¢æãããŸãã è¡ã®é·ããå¶åŸ¡ããŠã¿ãŸãããã
- #page {
- ããŒãžã³ïŒ40ãã¯ã»ã«èªå;
- ããã£ã³ã°ïŒ0 1em;
- æå€§å¹ ïŒ61.75em; / * 988px / 16px = 61.75em * /
- }
ããŒãžã³ãšããã£ã³ã°ã䜿çšããŠå¶éãè¡ã ãã³ã³ãã³ããšãŠã£ã³ããŠã®å¢çã®éã«ç©ºçœãå ¥ããŸãã ã ãã ããã«ãŒã«ã®æåŸã®è¡ã§ã¯ãåŒã®ããªãšãŒã·ã§ã³ïŒfont-sizeã®èšç®çšïŒã䜿çšããŠããã¶ã€ã³ã®æå€§å¹ ã決å®ããŠããŸãã ã¬ã€ã¢ãŠãã®å¹ ïŒ988pxïŒãåºæ¬ãã©ã³ããµã€ãºïŒ16pxïŒã§é€ç®ããŠãemã®æ倧ãµã€ãºãèšå®ããŠãã¬ã€ã¢ãŠãã®ããããã®ãã¯ã»ã«å¹ ã決å®ã§ããŸããããã«ãããã¬ã€ã¢ãŠããçæ³çãª988pxãè¶ ããŠæ¡å€§ããã®ãé²ããŸãã ããããemã䜿çšããŠæ倧ãµã€ãºã決å®ããããããŠãŒã¶ãŒããã©ãŠã¶ãŒã®ãã©ã³ããµã€ãºã倧ãããããšãæå€§å¹ ïŒmax-widthïŒãæ¡å€§ããŸãã å°ããªCSSããã¯ã䜿çšãããšãIEã®å€ãããŒãžã§ã³ã§ãæ©èœãããã¡ãã·ã§ããã«ãªå°ããªããªãã¯ã§ãã
ãã¶ã€ã³ãé©åã«å¶éãããã®ã§ãããŒãžã¿ã€ãã«ããå§ããŠããã¶ã€ã³ã®åèŠçŽ ãåå¥ã«æäœããŸãããã ã¬ã€ã¢ãŠãã§ã¯ã5ã€ã®åãš4ã€ã®ç©ºçœææã䜿çšããåèšå¹ ã¯700ãã¯ã»ã«ã§ãã ãŸãã1çµã®å/空çœçŽ æã«ãã£ãŠããŒãžã®å·Šã®å¢çç·ããåé¢ãããŠããã144pxã®ããããã€ã³ãã³ããæäŸããŸãã ãŸããåºå®å¹ ã®èšèšã䜿çšããå Žåãäœæ¥ã¯éåžžã«ç°¡åã§ãã
- h1 {
- ããŒãžã³å·ŠïŒ144px;
- å¹ ïŒ700px;
- }
ããããããŽã ãã§äœæ¥ãããããåºå®ãŠãããã¯ããŸãé©ããŠããŸããã ãããŠãç§ã¯çžå¯Ÿçãªãµã€ãºã§äœæ¥ããŠããã®ã§ãããã¯ç§ã«æ°ä»ããŸããïŒã°ãªããã®åèŠçŽ ãšãã®äžã«ããèŠçŽ ã¯ãã³ã³ããã«å¯Ÿããçžå¯Ÿçãªå²åãšããŠè¡šçŸã§ããŸãã ã€ãŸãããã©ã³ããµã€ãºãå€æŽãããšããã¿ã¹ã¯ã®å Žåãšåæ§ã«ãå¿ èŠãªèŠçŽ ã®ãµã€ãºã ãã§ãªãããã®ãµã€ãºãšã³ã³ãããŒã®ãµã€ãºã®æ¯çãèæ ®ããŸãã ããã«ããããã¯ã»ã«ããŒã¹ã®èŠçŽ ã®å¹ ãããŒã»ã³ããŒãžã«å€æãããµã€ãºãå€æŽããŠãã°ãªããã®æ¯çãç¶æã§ããŸãã
ã€ãŸããããŽã ããã§ããŸãã
ãã¹ãŠãæ°ãã-å¿ãå»ãããå€ã
ã§ã¯ãã©ãããå§ããŸããïŒ
target ÷ context = result
ããã§ãïŒãã©ã³ããµã€ãºã®èšç®åŒã«æ»ããŸãã åãæ¯çã䜿çšããŠããã¯ã»ã«åäœã®åå¹ ãæè»ãªããŒã»ã³ããŒãžã«å€æã§ããŸãã ã¿ãŒã²ããã®700ãã¯ã»ã«ããéå§ããŠãããããŒã®ãµã€ãºãããŒã»ã³ãã§ååŸããŸãããããããŒã³ã³ãããŒã¯988ãã¯ã»ã«ã§ãã
ãã¯ã»ã«åäœã®ããããŒãµã€ãºã®å€ãããŒã»ã³ãã«å€æããŸãã
ãã®çµæã次ã®ããã«700pxïŒç®æšå€ïŒã988ïŒãã®ã³ã³ããã¹ãïŒããããŒã³ã³ãããµã€ãºïŒïŒã§å²ãã ãã§ãã
700 ÷ 988 = 0.7085
ãããŠä»ïŒ0.7085ã¯70.85ïŒ ã«å€ãããŸããããã¯ãã¹ã¿ã€ã«ã·ãŒãã«å ¥åã§ããå¹ ã§ãã
- h1 {
- å¹ ïŒ70.85ïŒ ; / * 700px / 988px = 0.7085 * /
- }
144pxãã€ã³ãã³ãã§ããŸããïŒ äž»ãªè³ªåã倧奜ãã§ãïŒ
144 ÷ 988 = 0.14575
ãŸãã0.14575ãã€ãŸã14.575ïŒ ãååŸããã¹ã¿ã€ã«ã·ãŒãã«ã¿ã€ãã«ã®å·ŠããŒãžã³å€ãšããŠè¿œå ããŸãã
- h1 {
- ããŒãžã³å·ŠïŒ14.575ïŒ ; / * 144px / 988px = 0.14575 * /
- å¹ ïŒ70.85ïŒ ; / * 700px / 988px = 0.7085 * /
- }
ãããŠã»ã ã ããããŒã®ã€ã³ãã³ããšã³ã³ããã«å¯Ÿããå¹ ã枬å®ããããšã§ãã°ãªããã®å²åãããŒã»ã³ããŒãžã«å€æããããšã«æåããŸããã ãã©ãŠã¶ãŠã£ã³ããŠã®ãµã€ãºã«åãããŠã¹ã±ãŒãªã³ã°ãããå Žåã§ããããããŒã®æ¯çã¯åžžã«çã®ãŸãŸã§ãã
åæ§ã«åçŽãªå€æãé©çšããŠãã¡ã€ã³ã³ã³ãã³ããå«ããããã¯ã®çžå¯Ÿçãªãµã€ãºã決å®ã§ããŸãããµã€ãºã¯844pxã§ãå¹ ã¯124pxã®å·ŠåŽã«ã€ã³ãã³ãããããŸãã ããã¯ïŒ
844 ÷ 988 = 0.85425
ãŸããæ å ±åã«ã€ããŠïŒ
124 ÷ 988 = 0.12551
ãããã®2ã€ã®å€æã«ãããã¹ã¿ã€ã«ã·ãŒãã«è¿œå ã§ããããŒã»ã³ããŒãžå€ãåŸãããã¬ã€ã¢ãŠããããã«æè»ã«ãªããŸãã
- .entry h2ã
- .entry .content {
- ãããŒãïŒå³;
- å¹ ïŒ85.425ïŒ ; / * 844px / 988px = 0.85425 * /
- }
- .entry .info {
- floatïŒå·Š;
- å¹ ïŒ12.551ïŒ ; / * 124px / 988px = 0.12551 * /
- }
ãããŠã ããŽã ããååŸããããã«ããã«äžæ©åé²ããŸãã
ã³ã³ããã¹ããå€æŽ
ãããŸã§ãäž»èŠãªæ å ±ãããã¯ãé 眮ããŸãããããããã®ã³ã³ãã³ãã«ã¯è§ŠããŸããã§ããã ããã§ãããã°ã®ã³ã³ãã³ãèŠçŽ ã¯å¹ å šäœãå ããäžäžã«é 眮ãããŸãã ãã ããã¡ã€ã³ã³ã³ãã³ãèŠçŽ ã¯5åã®ã¿ãå æããè¿œå æ å ±ã¯å³ç«¯ã®åã«é 眮ããããšãèšç»ããŸããã
泚ææ·±ãèªè ã¯ãã¡ã€ã³ãããã¯å ã®æ å ±ã³ã³ãããŒã®çŸåšã®å¹ ãããããŒã®å¹ ïŒ700pxïŒãšåãã§ãããã·ããã巊端ã®åïŒä»¥åã«æºåããã¹ã¿ã€ã«ïŒ124pxïŒïŒãšåãã§ããããšã«æ°ä»ããŸããã ãã®ãããæ¢ã«èšç®ããããã£ã¡ã³ã·ã§ã³ãåŒãç¶ã䜿çšããŸãããåãåŒã䜿çšããããšã¯ã§ããŸãããã³ã³ããã¹ããå€æŽãããŸããã
æ°ããã³ã³ããã§äœæ¥ããŠããããããã®å¹ ãã³ã³ããã¹ããšããŠäœ¿çšããå¿ èŠããããŸãã
以åã¯ãã³ã³ãã#pageã®å¹ 988 pxã«å¯Ÿããå²åãèšç®ããŠããŸããããçŸåšã¯ã¯ããã«å°ããã³ã³ãã.entry .contentã䜿çšããŠããŸãã ãã®ãããã³ã³ããã¹ããå€æŽãã.entry .contentã®å¹ ãåç §ãã€ã³ããšããŠäœ¿çšããå¿ èŠããããŸãã ãããã£ãŠãã¡ã€ã³ã³ããŒèŠçŽ ã®ããŒã»ã³ããŒãžããŒã¹ã®å¹ ã決å®ããã«ã¯ããã®å¹ ïŒ700pxïŒãååŸãã芪ã³ã³ãããŒã®å¹ ïŒ844pxïŒã§é€ç®ããŸã
700 ÷ 844 = 0.82938
ãããŠã124ãã¯ã»ã«å¹ ã®å³ã®åã§ã¯ãåãåç §ãã€ã³ãã䜿çšã§ããŸãã
124 ÷ 844 = 0.14692
ããã§ããããã®èšç®ã®çµæãååŸããŠCSSã«åã蟌ãããšãã§ããŸãã
- .entry .main {
- floatïŒå·Š;
- å¹ ïŒ82.938ïŒ ; / * 700px / 844px = 0.82938 * /
- }
- .entry .meta {
- ãããŒãïŒå³;
- å¹ ïŒ14.692ïŒ ; / * 124px / 844px = 0.14692 * /
- }
å®éãããã§äœæ¥ã¯çµäºãã ããŽã ãã¯çµäºããŸãã
ãããã«
CSSã®ãããã³ã°ã®æ¬ åŠããæšæž¬ã§ããããã«ãã¯ãã¹ãã©ãŠã¶ã®åé¡ã¯ã»ãšãã©ãããŸããã§ããã CSSã®ãµããã¯ã»ã«ã®åé¡ã«é¢ãã John Resigã®èšäºã匷ããå§ãããŸãã 圌女ã¯ãããŸããŸãªãã©ãŠã¶ãããŒã»ã³ããŒãžå¹ ãåŠçããæ¹æ³ãšããµããã¯ã»ã«ã®æž¬å®å€ãäžèŽããã¡ã«ããºã ã説æããŸãã
Johnã圌ã®èšäºã§èª¬æããŠããããã«ãææ°ã®ãã©ãŠã¶ãŒãå¹ 50ïŒ ã®ã³ã³ãããŒã§å¹ 25ïŒ ã®4ã€ã®èŠçŽ ã䜿çšããå Žåã12.5ãã¯ã»ã«å¹ ã®èŠçŽ ãæç»ã§ããŸããã 代ããã«ãã»ãšãã©ã®ãã©ãŠã¶ãŒã¯åå¹ ãããŒã¯ã¢ããã«æé©ã«äžèŽããããã«å€§ããæŽæ°ãŸãã¯å°ããæŽæ°ã«äžžããŸãã Internet Explorerã¯ããã€ãã®ããã«ãåã«å€§ããªå šäœã«äžžããã ãã§ãããŒã¯ã¢ãããå£ããŸãã
ã°ãªããã§ããªãäžè¬çãªã€ã³ãã³ãã䜿çšããå Žåãããã¯åé¡ã§ã¯ãããŸããã ããããIEãããŒã¯ã¢ããã«äžèŠãªãã¬ãŒã¯ãåŒãèµ·ããå ŽåãããŒã»ã³ãå¹ ã§åã移åãããšãã¿ãŒã²ããå¹ ã1ãã¯ã»ã«æžããããšãã§ããŸãã ããšãã°ãå·ŠããŒãžã³ãIEã«å¯ŸããŠå€§ããããå Žåãèšç®ã次ããå€æŽã§ããŸãã
124 ÷ 988 = 0.12551
ããçãå¹ 123pxïŒ
123 ÷ 988 = 0.12449
IEåºæã®ã¹ã¿ã€ã«ã·ãŒãã«12.449ïŒ ã®å¹ ãè¿œå ãããšããã¹ãŠåé¡ãããŸããã
ããããå Žé¢ã«å¯Ÿå¿ããã°ãªãã
ãã¡ãããäžèšã¯ãã¹ãŠåºçºç¹ã«éããŸãããããŽã ãã§ã¿ã€ãã»ãã¿ãŒãåäœããã®ãåŸ ã€ç¡æ°ã®åé¡ããããŸããã»ãšãã©ã®åé¡ã¯ãããŽã ãã®ã³ã³ããã¹ãã§åºå®å¹ ã®ã³ã³ãã³ãïŒç»åãFlashãªã©ïŒãæäœãããšãã«çºçããŸãã ããã°ã§å¯èœãªè§£æ±ºçãè©ŠããŸããããå®ç§ãªè§£æ±ºçã¯ãŸã ãããŸããã
ãããŠæåŸã«ãã¬ã€ã¢ãŠããåçŽã§ãéèŠã§ã¯ãªããåºå®ã¬ã€ã¢ãŠããŸãã¯ããŽã ããšèšã£ãŠããããã§ã¯ãããŸããã ããããéå»æ°å¹Žéã§éæããããšãæ€èšããåŸãããŒãã«ãæŸæ£ããäŒç€Ÿãšäžè¬çãªå°éåéã®åºæºãç¥ç€Ÿã®ã¬ãã«ã«åŒãäžããç§ãã¡ã¯æé«ã®ãã©ãŠã¶æšæºåãéæããããšããŠããŸããç»é¢è§£å床ãã çµå±ã®ãšããããŠãŒã¶ãŒã®ãµãŒãã£ã³ç¿æ £ã¯ãç§ãã¡ãæ³å®ã§ããã»ã©äºæž¬å¯èœã§ã¯ãããŸããã ããŽã ãã®å¯èœæ§ãããªãã®æ³ååãåºæ¿ããããšãé¡ã£ãŠããŸãããã®æè¡ã®ããªãã®å¿çšãåãã§èŠãŠãããŸãã ãŠãŒã¶ãŒã ãã§ãªãã
ããã«èªã
ã©ãããŠ