我不能將文本居中在垂直列表中。麻煩的是當一個訂單項居中時,兩個訂單項分散。如何居中垂直列表?
的代碼是:
/*This is the one which works with more than one line links*/
.enlaces .enlacePortada a{
display: block;
padding: 0em 0.1em;
margin:auto;
}
/*The following works with single line links: */
.enlaces .enlacePortada a{
display: block;
padding: 0em 0.1em;
margin-top: 0.2em;
margin: 0.4em auto 0.3em auto;
}
我也試過:
vertical-align: middle;
text-align: center;
align-content: center;
並沒有任何變化。
這裏是一個簡約樣本:http://jsfiddle.net/uZmQL/
請提供一個工作示例。例如:訪問http://jsfiddle.net/並填寫一些HTML和CSS,按'Run'查看它是否按照您的預期工作,然後按下'Save'並在您的問題中分享網址。 – ANeves
感謝您的回答。 以下是一個示例:http://jsfiddle.net/uZmQL/ – Bushra