Please try and do some research – I promise it is super easy.
ul{
max-width:700px;
margin:auto;
list-style: inside;
}
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>
The margin:auto
property centres items, providing you have a width.
You could place it in a <div>
container which is centered using margin:0;
and its parent set to display:flex;
Let me know if that works or paste your code.
Your list items <li>
needed to have their own closing tags each </li>
even these little errors can cause an entire web page to not work also it’s just <br>
Code
<div class="list-container">
<ul>
<li>Stainless steel capacity: 0.5mm</li><br>
<li>Aluminum, copper, zinc, steel capacity: 0.8mm</li><br>
<li>Steel, Plastisol capacity: 0.8mm</li><br>
<li>Length: 310mm</li><br>
<li>Width: 320 - 610mm</li><br>
<li>Closing length: 210mm</li><br>
<li>Weight: 3.3kg</li><br>
</ul>
</div>
then in your head you will need to add this style…
<style>
.list-container {
display: flex;
width: 100%;
}
.list-container ul {
margin: auto;
}
</style>
If you are still having issues you can email me at [email protected]
I want to centralise the below text but keep the text alignment to the left. i.e. I want to keep the left margin the same size for each line of text:
<li>Stainless steel capacity: 0.5mm<br />
<li>Aluminum, copper, zinc, steel capacity: 0.8mm<br />
<li>Steel, Plastisol capacity: 0.8mm<br />
<li>Length: 310mm<br />
<li>Width: 320 - 610mm<br />
<li>Closing length: 210mm<br />
<li>Weight: 3.3kg<br /></li>
Seems like CSS would work just fine here. What have you tried?
Wrap your list in an inline-block container, that should do the trick.
Sorry I’m completely new to coding. Please could you explain how I would do this with the below code?