Ich habe 3 Bootstrap-Spalte nebeneinander. Ich möchte, dass die linke und die rechte Spalte statisch sind und nur die mittlere Spalte.Wie man einen Bootstrap linke und rechte Spalte statisch macht
Ich habe versucht, die Spalten zu fixieren, aber das ändert die Breite der Spalte und wenn ich die richtige Spalte fest, dann wird es links von der Seite geschoben.
Gibt es eine andere Möglichkeit, es ohne das feste Attribut zu beheben?
Hier ist ein Bild von meiner Seite.
Hier ist mein Code:
<div class=" col col-sm-2 leftBar" style="padding: 10px;">
<div style="padding: 10px 10px; border-radius: 5px; background-color: #87CEEB;">
<div class="list-group">
<a href="#" class="list-group-item active">List <span class="badge">4</span></a>
<a href="#" class="list-group-item"> List Item 1</a>
<a href="#" class="list-group-item"> List Item 2</a>
<a href="#" class="list-group-item"> List Item 3</a>
<a href="#" class="list-group-item"> List Item 4</a>
</div>
</div>
</div>
<div class=" col col-sm-8 centreContent" style="padding: 10px;">
<div style="padding: 10px 10px; border-radius: 5px; background-color: #DCDCDC;">
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
<p>This is the content</p>
</div>
</div>
<div class=" col col-sm-2 rightBar" style="padding: 10px;">
<div style="padding: 10px 10px; border-radius: 5px; background-color: #87CEEB;">
<p>This is the Right Bar</p>
</div>
</div>
Wenn Sie RightBar auf der rechten Seite positionieren, wird die Position behoben wird gut funktionieren. https://jsfiddle.net/9zgeqv3s/ plus ein Bootstrap-Offset auf einer zentralen Spalte –
Thanx @ GL.awog. Das hat so funktioniert, wie ich es wollte. Bitte posten Sie es als Antwort, damit ich es akzeptieren kann. – Damian