【发布时间】:2016-01-20 06:08:45
【问题描述】:
我正在尝试将自定义 GMail 图标添加到我的引导按钮。不幸的是,渲染后看起来很尴尬。我希望 GMail 图标和标签在垂直和水平方向居中。
CSS
.gmail a{
font-size: 23px;
font-style: normal;
padding: 8px 6px;
}
.gmailicon {
*margin-right: .3em;
vertical-align: text-top;
width: 33px;
height: 30px;
line-height: 30px;
background-image: url("/assets/cacheable/images/social/gmail1.png");
background-position: 10% 50%;
background-repeat: no-repeat;
}
html
a.btn.btn-default.btn-xlarge(href='/auth/google', target='_top')
i.gmailicon #{getMessage('Gmail')}
输出是
【问题讨论】:
-
添加你的代码 jsfiddle
-
@DrinkinPeople 如果将背景位置居中,标签将重叠在图像上。
标签: html css twitter-bootstrap pug