<div id="one" style="width: 500px; height: 800px;">
<div id="two" style="width: 1024px; height: 1024px; background:url('...')">
<div id="three" style="width: 300px; height: 600px; mrgin: 0 auto;"></div>
</div>
</div>
蓝色:one
红色:two
黄色:three
<div id="one" style="width: 500px; height: 800px;">
<div id="two" style="width: 1024px; height: 1024px; background:url('...')">
<div id="three" style="width: 300px; height: 600px; mrgin: 0 auto;"></div>
</div>
</div>
蓝色:one
红色:two
黄色:three
3 回答5.2k 阅读✓ 已解决
5 回答2k 阅读
2 回答2.6k 阅读✓ 已解决
4 回答1.7k 阅读✓ 已解决
2 回答1.9k 阅读✓ 已解决
3 回答1.1k 阅读✓ 已解决
1 回答3k 阅读✓ 已解决
1: 定位: 把one设为position: relative;
two:的属性如下
2: 背景, 你想把two做成背景图么?
用背景的属性background-position: center; 可以做到背景居中