我正在制作一个仪表板页面,用于为我的网站发布文章。 我有一个侧边栏和一个部分,我的发布页面将出现在该部分中,但该页面未占用该部分的全部大小... 这是我的问题的截图https://ibb.co/kuZBQm
.container {
width: 100%;
height: auto;
}
aside {
float: left;
width: 200px;
height: 500px;
border: 1px solid;
}
section {
width: 100%;
height: 500px;
border: 1px solid red;
}
<div class=" container">
<aside>
<a href="#" onclick="load_topgamespost()"><button> Top Games</button></a>
</aside>
<section id="section"></section>
</div>
<script>
function load_topgamespost() {
document.getElementById("section").innerHTML = '<object type="text/html" data="/topgames/topgamespost"></object>';
}
</script>
最佳答案
所以您的 section
大小正确,问题在于其中的 object
元素。
使用
section object{
width:100%;
height:100%;
}
关于javascript - 页面没有占用整个 div 的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46936831/