Wie richten Sie die form, die horizontal in der Mitte des div in der bootstrap
<div class="container">
<div class="row clearfix">
<div class="col-md-12 column">
<form role="form">
<div class="form-group">
<label for="exampleInputEmail1">Email address</label><input type="email" class="form-control" id="exampleInputEmail1" />
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label><input type="password" class="form-control" id="exampleInputPassword1" />
</div>
<div class="form-group">
<label for="exampleInputFile">File input</label><input type="file" id="exampleInputFile" />
<p class="help-block">
Example block-level help text here.
</p>
</div>
<div class="checkbox">
<label><input type="checkbox" /> Check me out</label>
</div> <button type="submit" class="btn btn-default">Submit</button>
</form>
</div>
</div>
</div>
Ich bin mit bootstrap.
Und ich will richten das Formular in der Mitte dieses div col-md-12 column
.
Irgendwelche Lösungen für?
Horizontal oder Vertikal?
Horizontal....
Horizontal....
InformationsquelleAutor user3155047 | 2014-01-02
Du musst angemeldet sein, um einen Kommentar abzugeben.
Können Sie zwei Lösungen haben hier mit der Eigenschaft
display
.Eins mit
inline-block
:Zwei mit
table
:Wenn Sie eine Feste
width
für das Formular müssen Sie nur fügen Sie diemargin:auto
InformationsquelleAutor DaniP
Demo http://bootply.com/103569
Könnten einen offset wie:
oder
http://getbootstrap.com/css/#grid-offsetting
InformationsquelleAutor Purple Hexagon
Geben Sie Ihrem Formular eine Klasse
und fügen Sie den folgenden Stil, um ihn
http://bootply.com/103575
InformationsquelleAutor Ahm3d Said
Ich würde versuchen, indem
zu
Ende mit
sowie das erstellen der style-Deklaration:
wenn man bedenkt, dass
.center
muß eine Feste Breite, die kleiner ist als die Breite der container.Hoffe, das hilft.
InformationsquelleAutor jamesJosephFinn