它不是集中在包含div的寬度100%的<h2>
元素。在50%的中心很好,但在100%時它擁抱了左邊緣。保證金0自動阻止50%的工作,但不能100%
顯示屬性未在直接父級div中定義。它在父級的父級中定義,但將其更改爲阻止似乎不會改變任何內容。是否有一個原因,我不能使用這種技術寬度100%?
編輯
main id="grid">
<section id="main_background_container">
<img id="main_side_img" src="images/background-1c.png"><img>
<div id="main_primary_container">
<div id="main_heading_container">
<h1 id="main_heading" >INTENSIVAO</h1>
</div>
<div id="main_subheading_container">
<h2 id="main_subheading">DE INGLES</h2>
</div>
<div id="info_primary_container">
<div id="info_container">
<div id="info_text_container">
<h1 id="info_text_place" class="penis_breath">Paulista</h1>
<h2 id="info_text_day" class="penis_breath">Sabados</h2>
</div>
<div id="info_time_container">
<p class="info_text_time" id="info_text_time_1">8h00 - 11h00</p><br>
<p class="info_text_time" id="info_text_time_2">12h00 - 15h00</p>
</div>
<div id="info_startday_container">
<h2 id="info_text_startday_explain">turmas começam</h2>
<h1 id="info_text_startday" class="penis_breath">10 de Maio</h1>
</div>
</div>
<div id="info_box_1"></div>
</div>
</div>
CSS
#main_primary_container{
width: 40%
background-image: url('../images/background-2b.png');
background-position: top;
background-size: cover;
height: 65%;
}
#info_primary_container{
float: left;
display: inline-block;
position:relative;
height: 100%;
width: 100%;
}
#info_text_container{
z-index: 2;
position: realtive;
width: 100%;
}
#info_startday_container{
width: 100%;
;
}
#info_text_startday_explain{
display: block;
width: 100%;
margin: 0 auto;
font-size: 2em;
color: $binaryColor0;
}
請分享您爲此書寫的html和css –
您是否得到了示例代碼來測試? –
你的意思是像這樣http://jsfiddle.net/hzGWk/? –