• Register

If you want to center a list in HTML then you need to follow the given code example, just use some CSS properties to center a list

In this problem, we will use CSS property for center list items in a webpage so before using CSS properties we need to know all about these CSS properties and its values:-

text-align : 
It is a CSS property and allow to center text or list in a webpage
it have three value ;

  • right – it’s used to display list in right side
  • left –  it’s used to display list items on the left side
  • center – it’s used to center list items

And here, we’re going to use the last one and we will also use the ordered and unordered list here.


 It is allowed to set a width and height on the element.


<!DOCTYPE html>
	<title>Center List</title>
<!-- Internal CSS -->

	text-align: center;
	display: inline-block;

		<h3>What is the full form of FAANG?</h3>

Here, you will see after using CSS property value the HTML list is centered

110 points