我在右側有一個側邊欄,我想爲左側的Tumblr帖子創建兩個居中的列。我能做什麼?在#wrapper
爲什麼我不能居中這個div?
#wrapper /*for two columns*/ {
display: inline-block;
margin: 15px 15px 15px 30px;
}
#wrapper .posts {
width: 400px;
margin: 0 15px 15px 0px;
padding: 10px;
}
#sidebar /*including some other stuff, obviously*/ {
display: table;
width: 250px;
height: 100%;
position: fixed;
top: 0px;
right: 0px;
}
請包括html – kheld
'display:table;身高:100%;'這不起作用。您無法控制具有'display:table;'的元素的高度。 – connexo
@connexo然而,它確實有效!問題不在於身高,而在於圍繞#wrapper! – danya