如何在grails中设置文本字段大小

时间:2014-12-15 16:28:03

标签: css grails

我想增加grails应用程序中文本输入字段的大小(宽度)。 我搜索了main.css并找到了一个textarea条目,我成功地增加了textarea大小。

输入文本字段是否有等价物?或者如何增加它们?

彼得 多特蒙德德国

2 个答案:

答案 0 :(得分:0)

尝试这样的事情:

这是一个奇特的搜索字段,当您单击输入文本字段时,它会展开...

GSP

<div class="form-controller" id="s2">
 <g:remoteField  placeholder="${message(code: 'search.navbar.placeholder', default: 'Search ...')}" name="q" class="form-control"  update="searchPanel" paramName="q" url="[controller:'environments', action:'search']"></g:remoteField>
   </div>

CSS

#s2 {
    display: inline-block;
    *zoom: 1;
    *display: inline;

}

#s2 input {
    background: url(../images/search/search-white.png) no-repeat 10px 6px #fcfcfc;
    border: 1px solid #d1d1d1;
    font: bold 12px Arial,Helvetica,Sans-serif;
    color: #bebebe;
   /* width: 150px;*/
    margin-left: 1em;
    padding: 6px 15px 6px 35px;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.7s ease 0s;
}

#s2 input:focus {
    width: 200px;
     background: url(../images/search/search-dark.png) no-repeat 10px 6px #fcfcfc;
    color: #6a6f75;

}

答案 1 :(得分:0)

在main.css中试试这个:

input[type=text] {
    width: 600px;
}

它对我有用。