在此bootply中,欢迎词和表格都出现在左侧,但是我想把它放在中间,请问任何人可以告诉我怎么做吗?

<form id="form1">
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span1"></div>
                <div class="span10" style="margin-bottom: 6px; margin-top: 0px; background: #efeee9">
                    <img src="ui_resources/img/ title.jpg" alt="" align="left">
                    <h2 align="center" style="margin-top: 18px;"></h2>
                </div>
                <div class="span1"></div>
            </div>

            <div class="row-fluid">
                <div class="span1"></div>
                <div class="span10" style="background: #eee; border: 1px solid #ddd;">

                    <div class="span7 center login-header">
                    <h2 style="color:#E86537 " align="center">Welcome </h2>
                </div><!--/span-->
                        <div class="row-fluid">
                <div class="well span7 center login-box">
                    <div class="alert alert-info">
                        Please login with your Username and Password.
                    </div>




                        <fieldset>
                            <div class="input-prepend" title="Username" data-rel="tooltip" style="margin-left:80px;">
                                <span class="add-on"><i class="icon-user"></i></span><input autofocus="" class="input-large span10" name="j_username" id="username" type="text" value="">
                            </div>
                            <div class="clearfix"></div>

                            <div class="input-prepend" title="Password" data-rel="tooltip" style="margin-left:80px;">
                                <span class="add-on"><i class="icon-lock"></i></span><input class="input-large span10" name="j_password" id="password" type="password" value="">
                            </div>
                            <div class="clearfix"></div>

                            <div class="input-prepend" style="margin-left:80px;">
                            <label class="remember" for="remember"><input type="checkbox" id="remember" style="display:">Remember me</label>
                            </div>
                            <div class="clearfix"></div>

                            <p class="center span6" style="margin-left:80px;">
                            <button type="submit" class="btn btn-primary">Login</button>
                            New User<a href="/NewPatient">register</a>
                            </p>
                        </fieldset>

                </div><!--/span-->
            </div><!--/row-->


            </div><!--/row-->




                </div>
                <div class="span1"></div>
            </div></form>
            <div class="row-fluid">
                <div class="span1"></div>
                <div class="span10" style="margin-top: 6px;">
                <div class="span1"></div>

                </div>

            </div>

最佳答案

尝试在CSS中使用它

.row-fluid .login-header,
.row-fluid .login-box{
      float:none;
      margin:0 auto !important;
}

10-06 07:53