I am currently learning HTML programming. I have a problem:
If I put like this:
<html> <body align="middle"> HEADLINE <ol> <li>First Item</li> </ol> </body> </html>
The problem is the number (1.) is on the left when I wanted it to be aligned under the headline. How can I get the whole list item to the middle?
I need atleast 10 reputation to add pictures so I'll provide a link to another website for you to see the picture: ALIGNING
To make a right-aligned version of the list, only three changes need to occur. First, set the "UL" "text-align" to "right". Second, change the left "background-position" from "0" to "100%" - which makes the image align up with the right edge. And finally change "padding-left" to "padding-right".
Center Align Text To just center the text inside an element, use text-align: center; This text is centered.
You are aligning texts in the body.
Try this:
.center { text-align: center; list-style-position: inside; }
<h4 align="center">HEADLINE</h4> <ol class="center"> <li>First Item</li> </ol>
This is very old post but this this is the solution I did.
CSS:
.center { text-align: center; list-style-position: inside; } ol.center li { text-align: left; margin-left: 45%; }
HTML
<ol class="center">Lorem ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit, repellat. <li>List1<li> <li>List2<li> </ol>
Final Result would look lke this :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With