gpt4 book ai didi

css - GWT PushButton 图像/文本对齐

转载 作者:行者123 更新时间:2023-11-28 10:20:14 27 4
gpt4 key购买 nike

我正在尝试创建带有自定义颜色和图像/文本的按钮。添加颜色和图像/文本非常容易,但现在我在垂直对齐方面遇到了问题。 “text-alignment: center”帮助我实现了水平对齐,但在垂直方面却没有成功。

<ui:style>
.gwt-b {
margin: 50px;
height: 23px;
width: 60px;
color: #fff;
font-size: 12px;
font-family: arial, sans-serif;
text-align: center;
vertical-align: middle;
background: -webkit-linear-gradient(top,#4d90fe,#357ae8);
border: 1px solid #3079ED;
outline-color: #3079ED;
outline-width: 3px;
}
</ui:style>

<g:HorizontalPanel>
<g:PushButton ui:field='pushButton' enabled='true' addStyleNames="{style.gwt-b}">
<g:upFace image="{res.search}">
</g:upFace>
</g:PushButton>

<g:PushButton ui:field='pushButton2' enabled='true' addStyleNames="{style.gwt-b}">
<g:upFace>
<b>click me</b>
</g:upFace>
</g:PushButton>
<g:HorizontalPanel>

这是我得到的:

enter image description here

最佳答案

.gwt-b {        
...
line-height: 12px;
...
}

关于css - GWT PushButton 图像/文本对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9150613/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com