h2标签内的链接字体大小较小

时间:2016-04-01 16:16:34

标签: css html5 twitter-bootstrap css3 twitter-bootstrap-3

我想在font-size标记内找到正常h2的链接,该链接将被拉到右侧

如果不进入新线,我怎么能有不同的font-size

我希望这一切都在同一行...无论我把它放在链接里面它都会转到新行

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<h2 class="title-bg acenter">title
      <a class="heading pull-right" href="#">
              pull right link title
      </a>
</h2>

2 个答案:

答案 0 :(得分:1)

您可以尝试使用small,在引导程序中将font-size设置为65%(您可能需要设置small标记的样式,颜色明智)

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<h1>With small</h1>
<h2 class="title-bg acenter">title
     <a class="heading pull-right" href="#">
         <small> pull right link title</small>
     </a>
</h2>
<hr />
<h1>Without small</h1>
<h2 class="title-bg acenter">title
     <a class="heading pull-right" href="#">
         pull right link title
     </a>
</h2>

答案 1 :(得分:1)

请尝试这样:

<h2 class="title-bg acenter">title
     <a class="heading pull-right sm_font" href="#">
          pull right link title
     </a>
</h2>

CSS:

a.sm_font{font-size:12px}
相关问题