我擡頭看了一百萬個技巧,我無法得到這個工作,我知道還有其他類似的帖子。我很抱歉,如果它錯誤的人,但我需要我的代碼具體說明cuz我愚蠢。提前感謝你!我希望div容器contentContactBox以及其內部的所有div在調整瀏覽器窗口大小時按比例調整大小。 contentcontactBox的左側是一些文本,右側是谷歌地圖嵌入。我希望他們都按照窗口的大小按比例縮小。根據窗口大小調整div與內容一起調整大小
注:我知道我可能需要取出的位置是:絕對放在兒童的div
HTML:
<div id="contact" class="tab-pane fade in">
<div id="contentBoxContact">
<div id="map"></div>
<div id="contact-content">
<h1>Come see us downtown<br> and have a beer!</h1><br>
<h2 style="text-decoration: underline">Phone Number:</h2>
<h2>555-555-5555</h2><br>
<h2 style="text-decoration: underline">Email:</h2>
<h2>[email protected]</h2><br>
<h2 style="text-decoration: underline">Address:</h2>
<h2>
Fake Place<br>
414 2nd Avenue<br>
Fake Location<br>
</h2>
</div>
</div>
</div>
</div>
CSS:
body {
padding-top: 80px;
width: 100%;
height: 100%;
color: white;
background: url(/images/TaphouseTaps2.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.tab-content{
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
transition: all 1s ease-in-out;
}
#contentBoxContact {
margin-top: 54px;
width: 1185px;
height: 560px;
margin-left: -593px;
background: rgba(34,34,34,.75);
}
#contact-content {
position: absolute
margin-top: 8px;
margin-left: 40px;
line-height: 2px;
font-family: Titillium Web, Arial, Verdana, sans-serif;
color: white;
}
#map {
position: absolute;
width: 600px;
height: 500px;
margin-top: 30px;
margin-left: 550px;
}
我忘了提我使用的引導。 – Edge