gpt4 book ai didi

css - 在输入周围添加填充

转载 作者:太空宇宙 更新时间:2023-11-03 19:49:40 25 4
gpt4 key购买 nike

我正在处理这段代码。我想在此输入字段周围添加一些空间:

 <span class="theSpan">
<h:inputText id="search" class="input_style" value="#{accounts.searchString}"></h:inputText>
<h:commandButton value="Search by title" action="#{bookBean.searchByTitle(accounts.searchString)}">
<f:ajax execute="search" render="output"></f:ajax>
</h:commandButton>
</span>

CSS:

 .input_style {
width: 260px;
padding: 5px;
padding-right: 40px;
outline: none;
border: 2px solid #999999;
border-radius: 5px;
background-color: #FBFBFB;
/* font-family: Cambria, Cochin, Georgia, serif;*/
/* font-size: 16px;*/
/*background-position: 270px -10px;*/
/* background-image: url('http://www.kirupa.com/images/search.png');*/
background-repeat: no-repeat;
margin-bottom: 30px;
}

.theSpan {
vertical-align: baseline;
}

视觉效果:

enter image description here

如何在输入字段和表格之间添加一些空间?另外,如何将文本“按标题搜索”放置在带有输入字段的行中?

最佳答案

在输入样式后添加边距

.input_style{
margin-bottom:10px;
}

padding creates space inside the element and margin creates outside the element so you need to use margin.

“按标题搜索”在此使用 line-height css,line-height 应等于输入的高度

关于css - 在输入周围添加填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36452619/

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