2016-09-23 35 views
0

如何插入图标的span类并使图标充当搜索按钮。我正在使用一个词按cms,我正在使用单词按下的默认搜索。在文本框中添加引导程序span类图标

这里是我在我创建的搜索-form.php的

<div class="col-xs-7 input-group"> 
<form role="search" method="get" action="<?php echo home_url('/'); ?>"> 
     <input type="search" class="form-control styletext" placeholder="Search" value="<?php echo get_search_query() ?>" name="s" title="Search" /> 
     <span class="input-group-addon"> 
      <i class="fa fa-chevron-right" aria-hidden="true"></i> 
     </span> 
</form> 
</div> 

搜索代码,它看起来像这样 output

我要让这样的输出,使图标跨度类充当wordpress IDE中考虑的搜索按钮。

output

回答

1

试试这个:

<div class="col-xs-7"> 
    <form role="search" method="get" action="<?php echo home_url('/'); ?>"> 
    <div class="input-group"> 
     <input type="search" class="form-control styletext" placeholder="Search" value="<?php echo get_search_query() ?>" name="s" title="Search" /><span class="input-group-addon"><i class="fa fa-chevron-right" aria-hidden="true"></i></span> 
    </div> 
    </form> 
</div> 
+0

感谢您的answerr ..非常大的答案。我怎样才能使范围搜索行为像一个按钮 –

+0

,而不是'input-group-addon'使用'input-group-btn'与其中的按钮元素为更多的信息阅读[这里](http://getbootstrap.com/components /#input-groups) –

+0

再次感谢您的回答。当我把input-group-btn,图标消失了,唯一的左边是只有搜索栏 –

相关问题