下面的代码应该(?)将#inner1 和#inner2 放在同一位置,还是不应该?
无论如何,#inner1 和#inner2 的位置不同,尽管它们具有相同的父级。如何解决这个问题(在同一位置的位置)?
<html>
<head>
<style>
div {border:1px dotted}
#main {width:800px;height:600px;position:absolute;}
#outer {width:600px; height:400px; position:absolute; top:100px; left:100px}
#inner1 {position:absolute;right;5px;bottom:5px;height:200px;width:200px}
#inner2 {position:absolute;right:5px;bottom:5px;height:200px;width:200px}
</style>
</head>
<body>
<div id=main>
main
<div id=outer>
outer
<div id=inner1>
inner1
</div>
<div id=inner2>
inner2
</div>
</div>
</div>
</body>
</html>
最佳答案
right;5px;
在#inner1
语法错误。 (分号代替冒号)
关于html - 嵌套的 DIV 定位不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3554130/