在網頁中只有一個div之間有空格。將其重新創建爲jsfiddle http://jsfiddle.net/durN4/divs問題之間的另一個空間,其他答案不工作
問題出在「瑞士酒店藍嶺大道」橫幅和它下面的主要文本之間。 div標籤的頂部和底部有一個空格。這是因爲的jsfiddle頁上的CSS代碼...
#main_holder {
width: 75%;
min-width: 750px;
margin-right: auto;
margin-left: auto;
border: 5px solid #E2BE6A;
position: relative;
-moz-box-shadow: 0px 0px 21px 5px rgba(2, 1, 14, 0.6);
-webkit-box-shadow: 0px 0px 21px 5px rgba(2, 1, 14, 0.6);
box-shadow: 0px 0px 21px 5px rgba(2, 1, 14, 0.6);
height: auto;
}
#headline {
height: 155px;
border-bottom: 5px solid #E2BE6A;
width: 100%;
background: -ms-linear-gradient(top left, #FFFFFF 0%, #327EEF 100%);
background: -moz-linear-gradient(top left, #FFFFFF 0%, #327EEF 100%);
background: -o-linear-gradient(top left, #FFFFFF 0%, #327EEF 100%);
background: -webkit-gradient(linear, left top, right bottom, color-stop(0, #FFFFFF), color-stop(1, #327EEF));
background: -webkit-linear-gradient(top left, #FFFFFF 0%, #327EEF 100%);
background-image: linear-gradient(to bottom right, #FFFFFF 0%, #327EEF 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFFFFF",endColorstr="#327EEF",GradientType=1);
}
#rotator_holder {
height: 321px;
width: 100%;
border-bottom-width: 5px;
border-bottom-style: solid;
border-bottom-color: #E2BE6A;
position: relative;
}
#navbar {
height:35px;
width: 100%;
border-bottom-width: 5px;
border-bottom-style: solid;
border-bottom-color: #E2BE6A;
position: relative;
background-color: #FFF1CE;
}
#titlebar {
font-family: 'Habibi', serif;
font-size: 24px;
height: 30px;
width: 100%;
background: -ms-linear-gradient(top left, #327EEF 0%, #FFFFFF 100%);
background: -moz-linear-gradient(top left, #327EEF 0%, #FFFFFF 100%);
background: -o-linear-gradient(top left, #327EEF 0%, #FFFFFF 100%);
background: -webkit-gradient(linear, left top, right bottom, color-stop(0, #327EEF), color-stop(1, #FFFFFF));
background: -webkit-linear-gradient(top left, #327EEF 0%, #FFFFFF 100%);
background-image: linear-gradient(to bottom right, #327EEF 0%, #FFFFFF 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#327EEF",endColorstr="#FFFFFF",GradientType=0);
color: #000;
padding-top: 10px;
padding-bottom: 10px;
}
#main_content {
font-size: 18px;
background-color: #FFF1CE;
width: 100%;
-moz-box-shadow: inset 0px 0px 13px 6px #c4c6cf;
-webkit-box-shadow: inset 0px 0px 13px 6px #c4c6cf;
box-shadow: inset 0px 0px 13px 6px #c4c6cf;
}
#padding {
width: 94%;
margin-right: auto;
margin-left: auto;
font-family: "Open Sans", sans-serif;
}
我建議使用'浸軋left',而不是'' 縮進文本。 – 2013-03-09 16:54:26