[英]Using a glyphicon outside of bootstrap
How does one use a glyphicon without using bootstrap? 如何在不使用引导程序的情况下使用glyphicon ?
I like one particular glyphicon. 我喜欢一只特殊的雕ly。 It's called glyphicons-chevron-left.
它叫做glyphicons-chevron-left。 All it gives is this
它所提供的就是这个
<span class="glyphicons glyphicons-chevron-left"></span>
I've downloaded the free version and found the .png I needed and used it as such: 我已经下载了免费版本,并找到了我需要的.png并使用了它:
<input type="image" src="images/glyphicons-chevron-left.png" class = "back_btn"/>
But then, when I give this button height and width the image loses quality. 但是,当我指定此按钮的高度和宽度时,图像质量下降。 I was wondering if there is a way to do it better?
我想知道是否有更好的方法?
This is because Glyphicon is a font: one file containing all the icons in special vector format which allows resizing (if you resize a png image it will become ugly). 这是因为Glyphicon是一种字体:一个包含所有图标的特殊矢量格式的文件,该文件允许调整大小(如果您调整png图像的大小,它将变得很丑陋)。 You can directly download the Glyphicons on their website or even create your own set of icons if you only need some by using a tool like Icomoon (maybe Icomoon does not offer to select icons from Glyphicons, but you will surely find equivalent icons in other sets).
您可以直接在他们的网站上下载Glyphicons,或者如果只需要使用Icomoon之类的工具来创建图标,甚至可以创建自己的图标集(也许Icomoon不提供从Glyphicons中选择图标的功能,但是您肯定会在其他图标集中找到等效的图标)。
You have three options other than the one you have already tried. 除了已经尝试过的选项以外,您还有其他三个选项。
The disadvantage of this is some older browsers don't have SVG support (IE 8 and below I believe) 这样做的缺点是某些较旧的浏览器不支持SVG(我相信IE 8及以下版本)
Alternatively your third option is to head over to bootstraps website and customise your build and just include the glyphicons icons. 另外,您的第三个选择是前往引导网站并自定义您的构建 ,只包含字形图标。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.