خرید بک لینک
I am working on a wiki-style webpage. The coding is all mine. If it matches with Wikipedia's code, that is a coincidence. Anyway, the heading in the div that has the display property set to table is not centered despite the fact that I have text-align set to center.

Here is the HTML:
Code:

<div class="table">
<h2 class="contents">Contents</h2>

<ul class ="contents">
        <li>
                <a href = "#Childhood">
                        <span>1</span>
                        <span>Childhood</span>
                </a>
        </li>
</ul>
</div>

And here is the CSS:
Code:

div.table{border-style: solid; border-width: 1px; display: table; padding: 7px; width: 295.25; height: 21.2833;}
h2.contents{width: 55px; height: 16px; margin-top: 13.3px; margin-bottom: 3.33333px; font-size: 13.3px; text-align: center;}
ul.contents{margin-top: 3.98333px; margin-bottom: 3.98333px; width: 295.25;}

Why is the heading not centered in the div if the text-align is set to center? :confused:

برچسب: نویسنده: آیلین رضوانی تاريخ: پنجشنبه 7 دی 1396 ساعت: 1:11

صفحه بندی