alignment

0 ritika adhikary · August 23, 2015
how to center align a list? like i aligned one of my ul by using text-align:center. this resulted in aligning the text of the list in the center but the bullets are still stuck to left.

Post a Reply

Replies

Oldest  Newest  Rating
0 Jeff the Killer · August 24, 2015
try


<center>
<ul>

    <li>stuff</li>

    <li>stuff</li>

    <li>stuff</li>

    <li>stuff</li>

    <li>stuff</li>



</ul>
</center>
0 Jeff the Killer · August 24, 2015
or in ur style ul{text-align:center} (if it works that is)
0 Marco Schindler · September 1, 2015
Hello Grimmjow Jaguar,
the center-tag is outdated and is not being supported by HTML5.

To answer the question:
You can give the list a fixed width and center it using margin-left and margin-right.

Here's a pen as an example.
http://codepen.io/scriptasia/pen/GpRmga
  • 1

HTML / CSS / Web Design

107,318 followers
About

Discuss, share, ask, learn and teach HTML5 and CSS3.

Links
Moderators