你可以请任何人帮我编码这下面的一个
这是我当前的代码
<div id="loginBtn" class="loginBtn"><span>Log in</span></div>
div标签具有loginBtn类,span标签具有HTML页面中"登录"文本
.loginBtn {
background:url(images/loginBtn-center.jpg) repeat-x;
width:175px;
height:65px;
margin:20px auto;
border-radius:10px;
-webkit-border-radius:10px;
box-shadow:0 1px 2px #5e5d5b;
}
我创建的按钮使用1px图像。现在我无法放置"登录"文本中间的图像可以任何人帮助我完成的代码
文本显示在左上角。请帮助我。
5条答案
按热度按时间h9vpoimq1#
您可以使用
text-align: center; line-height: 65px;
Demo
中央支助系统
b4wnujal2#
这比"行高"更可预测
编辑(2018年):使用flexbox
hfsqlsce3#
有时它是由填充固定的。。如果你能玩那个,那么,它应该可以解决你的问题
对我很有效
rbl8hiat4#
我认为您可以像这样使用Padding:希望这个能帮到你。
k97glaaz5#
你可以用