Html 引导按钮问题

Html 引导按钮问题,html,css,button,Html,Css,Button,因此,我试图实现一个简单的搜索框与搜索按钮(引导),但我有一些问题与按钮。当我从bootstrap应用html和css时,我得到的是一个没有放大镜的隐藏按钮。当我把鼠标移到它应该在的地方时,我只有一个小矩形。还有,你知道为什么我的div.container和div.span 12没有在中心对齐吗 [无搜索按钮]! [分区span-12]! [div容器] 我的html: <div class="container"> <div class="row">

因此,我试图实现一个简单的搜索框与搜索按钮(引导),但我有一些问题与按钮。当我从bootstrap应用html和css时,我得到的是一个没有放大镜的隐藏按钮。当我把鼠标移到它应该在的地方时,我只有一个小矩形。还有,你知道为什么我的div.container和div.span 12没有在中心对齐吗

[无搜索按钮]! [分区span-12]! [div容器]

我的html:

<div class="container">
  <div class="row">
        <div class="span12">
            <form id="custom-search-form" class="form-search form-horizontal">
                <div class="input-append span12">
                    <input type="text" class="search-query" placeholder="Search">
                    <button type="submit" class="btn"><i class="icon-search"></i></button>
                </div>
            </form>
        </div>
  </div>
</div

您发现的示例需要Bootstrap 2.3.2,但在Bootstrap 3中不起作用。请看我的示例,当我调用Bootstrap 2(我称之为css和js)并删除您的css时,它会起作用,这样您就可以从一个干净的基础上创建样式:

/*
#自定义搜索表单{
保证金:0;
边缘顶部:5px;
填充:0;
}
#自定义搜索表单。搜索查询{
右侧填充:3px;
右填充:4px\9;
左:3倍;
左侧填充:4px\9;
*/
/*IE7-8没有边框半径,所以不要缩进填充*/
/*
页边距底部:0;
-webkit边界半径:3px;
-moz边界半径:3px;
边界半径:3px;
}
#自定义搜索表单按钮{
边界:0;
背景:无;
*/
/**下面的样式很好用*/
/*填充物:2px 5px;
边缘顶部:2倍;
位置:相对位置;
左:-28px;
*/
/*IE7-8没有边框半径,所以不要缩进填充*/
/*
页边距底部:0;
-webkit边界半径:3px;
-moz边界半径:3px;
边界半径:3px;
}
.搜索查询:焦点+按钮{
z指数:3;
}
*/


到目前为止还不错,谢谢,但现在我有一个问题:文本,如果短语太大,保持标题在图标后面。你知道怎么解决吗?我和ho刚刚注意到,我和那个引导程序以及我一直在使用的引导程序有冲突…它把我已经做的事情搞砸了。首先只加载一个版本的引导程序,如果可能的话,我推荐v3。要允许更多文本,请使输入字段整体更宽。
#custom-search-form {
        margin:0;
        margin-top: 5px;
        padding: 0;
    }

    #custom-search-form .search-query {
        padding-right: 3px;
        padding-right: 4px \9;
        padding-left: 3px;
        padding-left: 4px \9;
        /* IE7-8 doesn't have border-radius, so don't indent the padding */

        margin-bottom: 0;
        -webkit-border-radius: 3px;
        -moz-border-radius: 3px;
        border-radius: 3px;
    }

    #custom-search-form button {
        border: 0;
        background: none;
        /** belows styles are working good */
        padding: 2px 5px;
        margin-top: 2px;
        position: relative;
        left: -28px;
        /* IE7-8 doesn't have border-radius, so don't indent the padding */
        margin-bottom: 0;
        -webkit-border-radius: 3px;
        -moz-border-radius: 3px;
        border-radius: 3px;
    }

    .search-query:focus + button {
        z-index: 3;   
    }