Reputation: 5943
I have a list:
<div class="row">
<div class="col-md-12">
<ul class="text-center" style="list-style-position: inside; vertical-align: middle;">
<li>1234</li>
<li>123456789123</li>
<li>123456789123</li>
</ul>
</div>
</div>
The output:
How do I get the bullet points to align even if the li
elements aren't the same length, but keep the list centered?
Here is a Bootply.
Upvotes: 1
Views: 5864
Reputation: 43
Try this
<div class="row">
<div class="col-md-7 col-md-offset-5">
<ul class="text-center" style="list-style-position: inside; vertical-align: middle;text-align:left">
<li>1234</li>
<li>123456789123</li>
<li>123456789123</li>
</ul>
</div>
</div>
Upvotes: 0
Reputation: 128
You can use bootstrap offset class
<div class="row">
<div class="col-md-2 col-md-offset-5">
<ul style="list-style-position: inside; vertical-align: middle;">
<li>1234</li>
<li>123456789123</li>
<li>123456789123</li>
</ul>
</div>
</div>
Upvotes: 0
Reputation: 362290
You need to make the UL inline-block like this:
<div class="row">
<div class="col-md-12 text-center">
<ul class="text-left" style="display:inline-block;vertical-align:middle;">
<li>1234</li>
<li>123456789123</li>
<li>123456789123</li>
</ul>
</div>
</div>
http://www.bootply.com/XFzwCr74vu
Upvotes: 3