Note that there are some explanatory texts on larger screens.

plurals
  1. POCentering a list while maintaining no indentation
    text
    copied!<p>Okay, I have a list, and I want to center everything in it using CSS.</p> <p>Anyway, I googled it, and I found, to remove the list style, and no left margin. But, I want to center it also, so I use <code>text-align:center;</code>. But for some reason, the indent shows up, so it is not exactly in the center, which is what I want.</p> <p>If you want a example, there's one at <a href="http://tst.burngames.net" rel="nofollow">tst.burngames.net</a></p> <p>Since everyone apparently needs code when there's a website..</p> <p><strong>HTML:</strong></p> <pre><code>&lt;body&gt; &lt;div id="search"&gt; &lt;input id="search_input" placeholder="Search for game."&gt; &lt;ul id="search_list"&gt; &lt;li&gt; One &lt;/li&gt; &lt;li&gt; Two &lt;/li&gt; &lt;li&gt; Three &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p><strong>CSS:</strong></p> <pre><code>body { background: url(../images/fire.png) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } #search { background-color:white; border-color:black; border-style:double; border-width: thick; margin-left:auto; margin-right:auto; margin-top:auto; margin-bottom:auto; width:600px; height:100%; } #search_input { width:99%; height:50px; margin-top:20px; text-align:center; } #search_list { width: 99%; margin-left:auto; margin-right:auto; } li { list-style-type:none; padding-left: 0px; margin-top:10px; margin-bottom:10px; text-align:center; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload