Jump to content

How to center a list


Mario17503

Recommended Posts

How can I center a list? 

If I use the attribute style="text-align: center;", I get something like that:

•                                Coffee

•                                  Tea

•                                  Milk

But points don't get centered. Can you help me?

Link to comment
Share on other sites

What does your code look like?

This works as expected for me.

<!DOCTYPE html><html lang="en"><head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0, user-scalable=yes"/>
<title> Test Page </title>
<!-- From: https://w3schools.invisionzone.com/topic/62126-how-to-center-a-list/ -->
<style>
 ul { text-align: center; }
</style>

</head><body>

<ul>
 <li> Coffee </li>
 <li> Tea </li>
 <li> Milk </li>
</ul>

</body></html>

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...