티스토리 뷰

You should be using CSS for this.
The <center> tag is deprecated.
At the moment, you are centering the whole list, not the list items, which may cause the issue. So if you want your links centered, you need to wrap every single <li> inside a <center>. Hope, this helps.

A better solution would be, to add CSS to the <ul>. Change it to

<ul style="display: flex; flex-direction: column; align-items: center;">

This will make the list a CSS-Flexbox with the child elements displayed in a column and centered.

-------------------

Have you tried using a table instead of a list? You can place the links in a table, center the table, and center the text in the table.

-------------------

중앙 정렬을 위해 UL 태그에서 아래 스타일을 사용하십시오.

<ul class="centerNavList">

<style>
.centerNavList {
    margin: auto;
        width: 50%;
            padding: 12px;
            }
            </style>
            
-------------------

때로는 제대로 작동하지 않기 때문에 중앙 태그를 사용할 필요는 없지만 사용자 정의 CSS는 결코 beatray;). 도움이되기를 바랍니다

ul{
position:relative;
display: inline-block;  
list-style: none;
width:100%;
text-align: center;
margin: auto;
padding: 0;
}

바이올린 센터 참조 Fiddle



출처
https://stackoverflow.com/questions/39940074
댓글
공지사항
Total
Today
Yesterday
«   2025/06   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30