Twitter Bootstrap2.3.1でアイコンを指定します。
【準備】
1.「Twitter Bootstrap2.3.1の使用方法」の手順の通り、Twitter Bootstrapを配置しておきます。
【手順1】
1.HTMLファイル「index.html」(任意)を作成。
2.「index.html」を以下の様に入力。
<!DOCTYPE html> <html> <head> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" /> </head> <body> <i class="icon-star" /><br /> <i class="icon-heart" /><br /> <i class="icon-envelope" /><br /> <script src="http://code.jquery.com/jquery.js"></script> <script src="bootstrap/js/bootstrap.min.js"></script> </body> </html>※指定するアイコン名はIcons by Glyphiconsを参考にして下さい。
【手順2】
1.各クラスは以下の様に定義されていました。
[class^="icon-"], [class*=" icon-"] { display: inline-block; width: 14px; height: 14px; margin-top: 1px; *margin-right: .3em; line-height: 14px; vertical-align: text-top; background-image: url("../img/glyphicons-halflings.png"); background-position: 14px 14px; background-repeat: no-repeat; } .icon-star { background-position: -120px 0; } .icon-heart { background-position: -96px 0; } .icon-envelope { background-position: -72px 0; }
【手順3】
以上です。
0 件のコメント:
コメントを投稿
注: コメントを投稿できるのは、このブログのメンバーだけです。