bootstrap三大核心之二。
bootstrap3提供了200多个免费图标字体。认为它是一个字。
arial-hidden="true"
.sr-only(只读)
1
|
<code class="html keyword" style="font-family: Consolas, " bitstream vera sans mono new courier monospace margin-top: margin-bottom: border: float: none left: auto line-height: outline: overflow: visible padding: position: static right: top: width: font-weight: bold font-size: min-height: color: background:>i class = "glyphicon glyphicon-search" > <code class="html keyword" style="font-family: Consolas, " bitstream vera sans mono new courier monospace margin-top: margin-bottom: border: float: none left: auto line-height: outline: overflow: visible padding: position: static right: top: width: font-weight: bold font-size: min-height: color: background:>i> |
i标签是已经废弃了的html斜体标签。用span也可以。使用时必须基于glyphicon glyphicon-xxx两个类的样式。
把网页的背景图片整合到一张图片中,利用背景定位显示出来。
定位的是做上点坐标,右边为x轴负方向,左边为y轴正方向。
1
|
background : url (路径) no-repeat 0 0 ; |
在CSS的最上面:导入第三方字体图标
1
2
3
|
<span style="font-family: 微软雅黑">@font-face{</span> font :字体名称;(自定义名称,避开网络安全字名) src : url (字体文件路径), url (字体文件路径), url (字体文件路径),…;} |
@font-face至少.woff,.eot两种格式的字体。一般还要加上SVG字体。
在button上应用字体图标:
1
|
<code class="html keyword" style="font-family: Consolas, " bitstream vera sans mono new courier monospace margin-top: margin-bottom: border: float: none left: auto line-height: outline: overflow: visible padding: position: static right: top: width: font-weight: bold font-size: min-height: color: background:>button class = "btn btn-default glyphicon glyphicon-log-in" > login <code class="html keyword" style="font-family: Consolas, " bitstream vera sans mono new courier monospace margin-top: margin-bottom: border: float: none left: auto line-height: outline: overflow: visible padding: position: static right: top: width: font-weight: bold font-size: min-height: color: background:>button> |
这是在按钮上应用字体图标的案例。可以在login上面加一个空格。不然会和图标挤在一起。
还有一种推荐的方式:
1
2
3
4
|
<code class="html keyword" style="font-family: Consolas, " bitstream vera sans mono new courier monospace margin-top: margin-bottom: border: float: none left: auto line-height: outline: overflow: visible padding: position: static right: top: width: font-weight: bold font-size: min-height: color: background:>button class = "btn btn-default" > <code class="html keyword" style="font-family: Consolas, " bitstream vera sans mono new courier monospace margin-top: margin-bottom: border: float: none left: auto line-height: outline: overflow: visible padding: position: static right: top: width: font-weight: bold font-size: min-height: color: background:>span class = "glyphicon glyphicon-log-in" > <code class="html keyword" style="font-family: Consolas, " bitstream vera sans mono new courier monospace margin-top: margin-bottom: border: float: none left: auto line-height: outline: overflow: visible padding: position: static right: top: width: font-weight: bold font-size: min-height: color: background:>span>
|
Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号