【发布时间】:2015-06-17 19:16:41
【问题描述】:
在一个 div 中,我有一些我希望它们重叠的图像。我希望它们都具有相同的中心并相对于它们的父 div 定位。现在,当我调整窗口大小时,我不希望它们也被调整大小......我怎样才能达到这种效果?抱歉没有代码。谢谢!
html:
<div class="columns small-6">
<h4 id="label_1">Πάγωσε η κόλαση...</h4>
<h4 id="label_2">Μπρρρ!</h4>
<h4 id="label_3">Κρύο</h4>
<h4 id="label_4">Έτσι κ'έτσι...</h4>
<h4 id="label_5">Καλό</h4>
<h4 id="label_6">Πολύ καλό!</h4>
<h4 id="label_7">Κάνεις κοιλιακούς!</h4>
<img class="button" src="static/thermostat.png">
<img class="slider unselectable" src="static/thermostat_slider.gif" draggable="false">
<div class="inside"><img class="inside_thing" src="static/inside_thing.png"><h3 class="give_joke">ΔΩΣΕ!</h3></div>
css:
.button {
position: absolute;
background-color: hsla(200, 0%, 0%, 0);
width: 100em;
top: 1.5em;
}
.slider {
position: absolute;
width: 90em;
}
.inside {
position: absolute;
width: 10em;
top: 11em;
left: 11.5em;
}
当然,调整窗口大小时,事物不会保持居中... 哦,我也用Foundation 5来做网格。
【问题讨论】:
-
你试过
max-width和max-height吗? -
你需要给我们一些代码。到目前为止,您尝试过什么?
-
我加了一些代码,你可能看不懂希腊文,没关系...
标签: html css resize position overlap