Ich versuche, mit Bootstrap 3.1 eine zweispaltige Layout zentriert zu haben. Ich habe gelesen, dies: How do I center a Bootstrap div with a 'spanX' class?, aber der Inhalt ist stil nach links ausgerichtet. Hier ist mein HTML:Bootstrap: zwei Spalte zentriert
<div class="row">
<div class="center">
<div class="col-lg-3 gauche">
Left div
</div>
<div class="col-lg-5 corps">
Right div
</div>
</div>
</div>
Und mein CSS:
body
{
padding: 0;
margin: 0;
}
.corps
{
background-color: white;
}
.contenu
{
margin-top: 5em;
margin-bottom: 1em;
background-color: white;
padding: 1.2em;
padding-left: 1.5em;
}
.center
{
float: none;
margin-left: auto;
margin-right: auto;
}
.gauche
{
background-color: #e6e6e6;
min-height: 200px;
}
Ergebnis ist hier: http://i.imgur.com/5nhZ2WS.png
Danke, das hat funktioniert! – user2820
Ihre Begrüßung. Wenn es half, bitte genehmigen Sie die Antwort. – moodyjive
Sollte col-lg-Offset-2 statt – swiss196