将字形添加到标题 [英] Add glyphicon to headings

查看:36
本文介绍了将字形添加到标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

就像在 this 答案中一样,我正在尝试将图标添加到 h3 标签.结果如下:

Like in this answer I'm trying to add icon to h3 tag. Here is a result:

<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css" rel="stylesheet"/>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<h1>Play it! <span class="glyphicon glyphicon-play text-primary"/></h1>

jsfiddle可用.

但是在 h3 标签内,图标变得太大了.我更喜欢这样的:

But inside h3 tag the icon becomes too big. I would prefer something like this:

如何使图标变小?

推荐答案

根据你的 HTML 添加 CSS:

According to your HTML just add the CSS:

h1 span.glyphicon-play{
    font-size: 0.5em;
    vertical-align: 5px;
}

这篇关于将字形添加到标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆