我正在爲我的女朋友做聖誕日曆。我在集中框和標題時遇到了一些問題。標題不居中,框開始向左多於右側。我已經將包裝設置爲邊距自動0.沒有解決我的問題。有什麼建議麼?中心Christmax日曆
body {
background: url("http://hamawandi.com/images/bg4.png") no-repeat center center fixed;
background-size: cover;
font-size:30;
margin: 0;
color: #666;
}
.wrapper {
width:70%;
margin:0 auto;
margin-bottom:10px;
margin-top:50px;
}
.calender-box {
width:130px;
height:130px;
background-image: url('/images/background-xmas3.png');
float:left;
border: 5px dotted red;
margin-left:10px;
margin-bottom:10px;
text-align:center;
font-size:45px;
color:white;
line-height:140px;
text-decoration: none;
}
.header{
font-size:40px;
color:white;
margin:0 auto;
margin-top:-10px;
}
<div class="wrapper">
<div class="header">
❄ Julekalender 2016 ❄
</div>
<a href="/luke1.php" class="calender-box">1</a>
<a href="/luke1.php" class="calender-box">2</a>
<a href="/luke1.php" class="calender-box">3</a>
<a href="/luke1.php" class="calender-box">4</a>
<a href="/luke1.php" class="calender-box">5</a>
<a href="/luke1.php" class="calender-box">6</a>
<a href="/luke1.php" class="calender-box">7</a>
<a href="/luke1.php" class="calender-box">8</a>
</div>
你爲什麼不只是使用一個表?誠然,日曆可能不是一張桌子,嚴格來說,但有人可能會爭辯說,日子(一週內)是列名,那麼你可以指出,嚴格來說日曆是一張桌子。 – junkfoodjunkie
問題是你的包裝是70%,這是比行中的x盒子更寬(檢查元素,你會看到不同的,在右側的空白空間)...所以,你的包裝應該有確切的寬度的期望框中的數字連續....此外,應該日曆響應,例如每行4,3或2個盒子,相對於屏幕寬度? – sinisake