I am on the"build a tribute page", and I can’t get the ul to center correctly (I used the text-center but then the bullet just goes all the way over to the left, away from my text, here is the code:
<div class="container">
<div class="jumbotron">
<div class="row">
<div class="col-xs-12">
<h1 class="text-center">Bill Gates</h1>
<h2 class="text-center"><i>The richest man on earth</i></h2>
<div class="img-thumbnail">
<img class="img-fluid" src="http://aib.edu.au/blog/wp-content/forum/uploads/2015/08/bill-gates-jpg.jpg">
<p class="text-center">Bill Gates, the owner of Microsoft, is the richest man on earth</p>
</div>
<br>
<h3 class="text-center">Timeline of Bill Gates' life</h3>
<ul class="text-center">
<li>Born</li>
</ul>
</div>
</div>
</div>
</div>
To achieve what you are trying to do, you could try one of the following suggestions depending on the style that you wish to achieve. This first one make the bullet part of the list content and centers it along with the text—you won’t be using this if you actually want the beginning of each list item to line up though:
Alternatively, and since you are using Bootstrap, you can simply place the list inside a column and offset it. Assuming you are using Bootstrap 4.0.0 alpha, you can do the following:
You can indeed use col-* in Bootstrap 4! It sort of replaced col-xs-* in Bootstrap 3 because there are five size tiers in Bootstrap 4 (instead of four in Bootstrap 3).
It is worth noting that in Bootstrap4 you also have the option of using unitless column classes—:
<div class="row>
<div class="col"><!-- This div behaves like .col-6 --></col>
<div class="col"><!-- This div behaves like .col-6 --></col>
</div>
Have a quick look at the Bootstrap documentation to see other cool, useful things you can do (source)!
I want ul bullets to start right beneath “fun facts”, but i can’t do that, i have no idea why,
or even, i would delete the bullets , but then texts needs to starts under “fun facts”, as all the texts before it. You know what i mean #beginner
Thanks
Hey, I had the same problem, and I temporarily solved it by placing div with row class and then 3 col-4 divs and I placed my list inside the second column, since it is a central one. Hope it helps.
hi
to solve this problem,just write this code in ul inside css file
ul {
text-align: left;
width: 40%;
position:relative;
left: 30%;
}
first we make text-align: left -----> text can be beside dotted bullet
then we make width: 40% -------> ul now has 40% width from its container(ex:div)
then we make position: relative —> to can move ul to any position relative to its current position
then we make left: 30% —> move ul to left 30% from current position,
to move it to center of container,why this number?
first ul has width= 40% so remaining 100-40=60
now to make it center divide number 60/2=30
all width= 30% left, 40% ul , 30% remaining … now this position is in center
Thanks.
Before, I was able to center my unorganized list, but the last sentence of each bullet would be centered on the page, and I wanted it to be aligned on the left side with the other text.
This worked really well for me.