I am trying to make to list with a vertical aligned text, but I couldn’t do it no matter how much I tried and searched. So, how do I achieve the following result using twitter bootstrap?!
Ahmed: what's your name?
Bob: ahmed
Cate: ok!
At the moment I have this, which I can’t seem to fix.
Ahmed: what's your name?
Bob: ahmed
Cate: ok!
HTML:
<div class="container-fluid" align="center">
<div class="jumbotron">
<ul style="list-style-type: none; vertical-align: middle;">
<li><h5><strong>Ahmed and his friends</h5></li>
<li><h5><strong>life is good</h5></li>
</ul>
</div>
</div>
2
Answers
What you will need it’s to have your ul tag centered on the middle of your page and the li align left
in css you can try to align the item on the right :
What you seem to want to do is have them left-aligned, and have that element in the middle of the screen.
The easy way to do this is by having 2 elements. The second element is rendered as
inline-block
instead ofblock
, so it is not greedy and does not take up all the horizontal space.