対象èªè
ãæ¬è¨äºã¯ã次ã®æ¹ã対象ã«ãã¦ãã¾ãã
- HTML5ï¼CSSï¼JavaScriptã使ã£ã¦Webã¢ããªã±ã¼ã·ã§ã³ã®ç»é¢ä½æãã§ããæ¹
- ãã¶ã¤ã³ã«èªä¿¡ã®ãªãæ¹
ãã¿ã³
ãWebã¢ããªã§ã¯ããã¾ãã¾ãªå¦çãè¡ãã®ã§UIã¨ãã¦ãã¿ã³ãé ç½®ãã¾ããããã®ãã¿ã³ã®æ¼ãããããåãããããã¯ãã¢ããªã®æä½æ§ã«å¤§ãããããã£ã¦ãã¾ããããã§ã¯ãBootstrapã®ãã¿ã³ãå©ç¨ããæ¹æ³ã«ã¤ãã¦èª¬æãã¾ãã
ã¹ã¿ã¤ã«
ãBootstrapã®ãã¿ã³ã¯buttonè¦ç´ ï¼aè¦ç´ ï¼inputè¦ç´ ã®classå±æ§ã«"btn"ãæå®ããã¨ãã¹ã¿ã¤ã«æå®ãã§ãã¾ãã
<button type="button" class="btn btn-default">buttonè¦ç´ </button> <a href="#" class="btn btn-default">aè¦ç´ </a> <input type="button" class="btn btn-default" value="inputè¦ç´ ">
ãè¦åã注æãªã©ãã¿ã³ã®ç¨éã«ãã£ã¦ããã¶ã¤ã³ãå¤ããã«ã¯ãclasså±æ§ã«ä»¥ä¸ã®å±æ§ãæå®ãã¾ããclasså±æ§ã¯è¤æ°ã®å¤ãæå®ã§ãã¾ããè¤æ°ã®å¤ãæå®ããã¨ãã¯ãå¤ãã¹ãã¼ã¹ã§åºåãã¾ãã
ç¨é | classå±æ§ã®æå® | è² |
---|---|---|
ããã©ã«ã | btn-default | ç½ |
ä¸»è¦ | btn-primary | é |
æå | btn-success" | ç· |
æ å ± | btn-info | æ°´è² |
注æ | btn-warning | ãªã¬ã³ã¸ |
è¦å | btn-danger | 赤 |
ãªã³ã¯ | btn-link | â |
<button type="button" class="btn btn-default">Default</button> <button type="button" class="btn btn-primary">Primary</button> <button type="button" class="btn btn-success">Success</button> <button type="button" class="btn btn-info">Info</button> <button type="button" class="btn btn-warning">Warning</button> <button type="button" class="btn btn-danger">Danger</button> <button type="button" class="btn btn-link">Link</button>
ãµã¤ãº
ããã¿ã³ã®ãµã¤ãºãæå®ããã«ã¯ãclasså±æ§ã«ãã¿ã³ãµã¤ãºãæå®ãã¾ããæå®ã§ãããµã¤ãºã¯æ¬¡ã®ã¨ããã§ãã
ãµã¤ãº | classå±æ§ã®æå® |
---|---|
大ãã | btn-lg |
ããã©ã«ã | ãªã |
å°ãã | btn-sm |
ã¨ã¦ãå°ãã | btn-xs |
<button type="button" class="btn btn-lg">大ããªãã¿ã³</button> <button type="button" class="btn">ããã©ã«ããã¿ã³</button> <button type="button" class="btn btn-sm">å°ãããã¿ã³</button> <button type="button" class="btn btn-xs">ã¨ã¦ãå°ãããã¿ã³</button>
ããµã¤ãºãåºå®ããã«ã¯ãclasså±æ§ã«"btn-block"ãæå®ãã¾ãããµã¤ãºã¯ã親ã³ã³ããã¼ã«ã®å¹ ã«å¿ãã¦è¨å®ããã¾ãã
<button type="button" class="btn btn-block">ãµã¤ãºæå®</button> <hr /> <div class="row"> <div class="col-xs-8"> <button type="button" class="btn btn-block">ãã¿ã³1</button></div> <div class="col-xs-4"> <button type="button" class="btn btn-block">ãã¿ã³2</button></div> </div>
æå¹åï¼ç¡å¹å
ããã¿ã³ãé¸æã§ããç¶æ ï¼æå¹åï¼ã«ããã«ã¯ãclasså±æ§ã«"active"ãæå®ãã¾ããã¾ãããã¿ã³ãé¸æã§ããªãç¶æ ï¼ç¡å¹åï¼ã«ããã«ã¯ãdisabledå±æ§ãæå®ãã¾ããç¡å¹åããã¨ããã¿ã³ã®è¡¨ç¤ºè²ãæ·¡ãè²ã«å¤ããã¾ãã
<button type="button" class="btn active">æå¹ãªãã¿ã³</button> <button type="button" class="btn" disabled="disabled">ç¡å¹ãªãã¿ã³</button>
ã°ã«ã¼ãå
ãé¢é£ãããã¿ã³ãã¾ã¨ãã¦ã°ã«ã¼ãããã«ã¯ãclasså±æ§ã«"btn-group"ãæå®ããdivè¦ç´ ã§ãã¿ã³ãã¾ã¨ãã¾ãããã¿ã³ã®ééããªããªãã端ã®ãã¿ã³ã®ã¿è§ã丸ããªãã¾ãã
<div class="btn-group"> <button type="button" class="btn btn-danger">Danger</button> <button type="button" class="btn btn-primary">Primary</button> <button type="button" class="btn btn-success">Success</button> <button type="button" class="btn btn-info">Info</button> </div>
ã¢ã¤ã³ã³ä»ãã¿ã³
ãã¢ããªã®æä½ã«é¢ãã説æãæç« ã§è¡¨ç¤ºãããããç´æçã«åããã¢ã¤ã³ã³ã§è¡¨ç¤ºããã¨åããããããã¿ã³ãä½æã§ãã¾ãããã¿ã³ã«ã¢ã¤ã³ã³ãæ¿å ¥ããã«ã¯ãspanè¦ç´ ã®classå±æ§ã«"glyphicon"ãæå®ãã¾ãã使ç¨ã§ããã°ãªãã¢ã¤ã³ã³ã®ä¸è¦§ã¯ä»¥ä¸ã®ãµã¤ãã«ããã¾ãã
ãä¾ãã°ããã¼ã ã¢ã¤ã³ã³ã表示ããã¨ãã¯ãclasså±æ§ã«"glyphicon-home"ãæå®ãã¾ãã
<button type="button" class="btn">ãã¼ã <span class="glyphicon glyphicon-home"></span> </button> <button type="button" class="btn">ãã¦ã³ãã¼ã <span class="glyphicon glyphicon-download"></span> </button>