ããã«ã¡ã¯ãã³ã¼ãã£ã³ã°æ å½ã®å²¡æ¬ã§ãã
ã¬ã¹ãã³ã·ãWEBãµã¤ããä½æããéã«ä¾¿å©ãªãã¼ã«ã¨ããã°ããTwitter Bootstrapããã¯ããã¨ãããCSSãã¬ã¼ã ã¯ã¼ã¯ããæåã§ããã
ç¹ã«ãTwitter BootstrapãããFoundationããBourbonããªã©ã¯ããã²ã¼ã·ã§ã³ããã©ã¼ã ãªã©ã®UIãã¼ãã¾ã§ç¨æããã¦ããã®ã§ãã¢ãã¯ã¢ããä½æãªã©ã«é常ã«éå®ããã¦ãã¾ãã
ãããããå®éã«ECãµã¤ããã³ã¼ãã£ã³ã°ããã¨ãªãã¨ããã®ãUIãã¼ãããåä»è ã«ãªããã¨ãããã¾ãã
ãã§ã«ä½æããããã¼ããçµã¿åããã¦ã®æ§ç¯ãåæã§ãã®ã§ãã©ããã¦ãããªãªã¸ãã«ãã¶ã¤ã³ãã«å¯¾å¿ãããæéãçãã¾ãã
ããã¦æ¢å®ã®ã¹ã¿ã¤ã«ãæã¡æ¶ãã¦åè¨å®ãããããCSSãã¡ã¤ã«ãè¥å¤§åããã¨ãããã¨ã«ã¤ãªãããã¨ããã¬ã¼ã ã¯ã¼ã¯ãå©ç¨ãããã¡ãªããã§ãããã¾ããã
ä»åç´¹ä»ããCSSãã¬ã¼ã ã¯ã¼ã¯ã¯éãã¾ãã
éå§ç¸®ã§100è¡ä»¥ä¸ã®è»½ãã«3種é¡ã®ã°ãªããã«å¯¾å¿ããã¬ã¹ãã³ã·ããã¬ã¼ã ã¯ã¼ã¯ããããä»åç´¹ä»ããResponsive Grid Systemã§ãã
Responsive Grid Systemã®ï¼ã¤ã®ç¹å¾´
Responsive Grid Systemã«ã¯ï¼ã¤ã®å¤§ããªç¹å¾´ãããã¾ãã
ããã¯
- 100è¡ä»¥ä¸ã®è»½éãµã¤ãº
- ã¢ãã¤ã«ãã¡ã¼ã¹ãå¿åã®è¨è¨
- 12ï½24ã®ã°ãªããã«å¯¾å¿
ã¨ãããã®ã§ãã
ããããã¯ãã®ç¹å¾´ã«ã¤ãã¦ï¼ã¤ãã¤ç´¹ä»ãããã¾ãã
ç¹å¾´ï¼ï¼100è¡ä»¥ä¸ã®è»½éãµã¤ãº
Responsive Grid Systemããã¦ã³ãã¼ãããã¨ãä¸ã«ã¯ï¼ã¤ã®ãã¡ã¤ã«ãå ¥ã£ã¦ãã¾ãã
ï¼ã¤ã¯IEã«å¯¾å¿ãããããã®ãie.cssããããï¼ã¤ã¯ãã©ã¦ã¶CSSããªã»ãããããreset.cssããããã¦ã¬ã¹ãã³ã·ãã°ãªãããè¨å®ã§ãããresponsive-gs-XXcol.cssãã®ï¼ãã¡ã¤ã«ã§ãã
ãã®ï¼ãã¡ã¤ã«ã®ç·å®¹éã¯ãªãã¨ãã£ãã®ã5KBãã
TwitterBootstrapã®å§ç¸®ãã¡ã¤ã«ãåè¨100KB以ä¸ã§ãã®ã§ãé常ã«è»½éãªãã¬ã¼ã ã¯ã¼ã¯ã§ããã¨ããã¾ãã
ç¹å¾´ï¼ï¼ã¢ãã¤ã«ãã¡ã¼ã¹ããªè¨è¨
ãã®ãã¬ã¼ã ã¯ã¼ã¯ã®ã¦ãã¼ã¯ãªã¨ããã¯ããã¹ãã¼ããã©ã³ç»é¢ãããã©ã«ããã¨ããè¨è¨ãããã¦ãããã¨ã§ãã
ã°ãªããå¹ ãå ¨ã¦100ï¼ ã«ãªãããã«è¨å®ããã¦ãããã¿ãã¬ãã以ä¸ã§ã¯MediaQueryå ã«è¨è¿°ãããCSSã§ã°ãªããåããããããã«ãªã£ã¦ãã¾ãã
ã¹ãã¼ããã©ã³ããè¨è¨ãããã¨ã§MediaQueryã«ããä¸æ¸ããæ¸ããããã¼ã¸ã®èªã¿è¾¼ã¿ãå°ãã§ãæ©ããããã¨ãå¯è½ã¨ãªãã¾ãã
ç¹å¾´ï¼ï¼ï¼ç¨®é¡ã®ã°ãªããã«å¯¾å¿
Responsive Grid Systemã®å¬ããã¨ããã«ã¯ããã°ãªããå¹ ã3種é¡ããé¸ã¹ããã¨ãããã®ãããã¾ãã
2013å¹´10ææç¹ã§12ã«ã©ã ã»16ã«ã©ã ã»24ã«ã©ã ã®3種é¡ãé å¸ããã¦ãããã³ã³ãã³ãã®å¹ ã«å¿ãã¦èªç±ã«ä½¿ãåãããã¨ãã§ãã¾ãã
ã¾ãããã®ãã¬ã¼ã ã¯ã¼ã¯ã«ã¯ãã°ãªããè¨å®ãããè¨è¿°ããã¦ãã¾ããã®ã§ãããã²ã¼ã·ã§ã³ããã©ã¼ã ãªã©ã®UIãã¼ãã®ã¹ã¿ã¤ã«ãèªç±ã«è¨å®ã§ããã¨ããã¡ãªãããããã¾ãã
Responsive Grid Systemã®ãã¡ãªãã
ããã¾ã§Responsive Grid Systemã®ã¡ãªããã«ã¤ãã¦ç´¹ä»ãã¾ãããããã¡ãããã¡ãªãããããã¾ãã
ããã¯ãIE8以åã«å®å ¨é対å¿ãã§ãããã¨ã§ãã
PCç»é¢ã®ãã¶ã¤ã³ããã¹ã§MediaQueryã§è¨å®ãã¦ãããããMediaQueryé対å¿ãã©ã¦ã¶ã§é²è¦§ããã¨ãã¹ãã¼ããã©ã³ç»é¢ãã表示ããããã¨ã«ãªãã¾ãã
ãã®ããå©ç¨ããéã¯ããIE8以åã®ãã©ã¦ã¶ã«å¯¾å¿ããããå¦ãããå®ç¾©ä»ãããå¿ è¦ãããã¾ãã
Responsive Grid Systemã®ä½¿ãæ¹
軽éã»ã·ã³ãã«ãªãã¬ã¼ã ã¯ã¼ã¯ã§ãã®ã§ã使ãæ¹ãé常ã«ç°¡åã§ãã
親è¦ç´ ã«class=”container”ãè¨å®ãåè¦ç´ ã«class=”row”ãè¨å®ããã°æºåã¯å®äºã
å«è¦ç´ ã«class=”col span_X”ãå ¥ãããã¨ã§ãã¿ãã¬ãã/PCç»é¢ã§ã°ãªããXååã®è¦ç´ ãä½æããã¾ãã
<main class="container"> <article class="row"> <section class="col span_4"> </section> <section class="col span_4"> </section> <section class="col span_4"> </section> </article> </main>
ãããªæãã§ããã
Clearfixç¨ã«ãclrãã¨ããã¯ã©ã¹ãè¨å®ããã¦ãã¾ããããrowãã使ç¨ãã¦ããã°ãã¾ã使ãå ´é¢ã¯ãªããã¨æãã¾ãã
ã¾ã¨ã
ãã¢ãã¤ã«ãã¡ã¼ã¹ããã¨ããè¨èã¯WEBå¶ä½ã®ä¸ã§ã¯åºãç¥ãããããã«ãªã£ã¦ãã¾ããã
ãããã¾ã ã¾ã PCãµã¤ããä½ã£ãå¾ãã¹ãã¼ããã©ã³åãã«å¯¾å¿ããããããªãã¶ã¤ã³ã»ã³ã¼ãã£ã³ã°ææ³ã主æµã§ãã
軽éãã¤æ±ããããCSSãã¬ã¼ã ã¯ã¼ã¯ã®Responsive Grid Systemã使ããã¨ã§ããã¢ãã¤ã«ãã¡ã¼ã¹ãããªWEBãµã¤ãå¶ä½ã®ä¸æ©ç®ãè¸ã¿åºãã¦ã¿ã¦ã¯ãããã§ããããï¼