html - 按百分比调整表格行不起作用

标签 html

为什么尺寸根本没有改变?我的理想目标是让第一行占 70%,第二行占 30%。任何建议将不胜感激

<html>
<body style="position:fixed; top:0px; left:0px;bottom:0px; right:0px;  margin:0px;">
    <div style='display : table; width : 100%; height : 100%'>
        
        <div style='display : table-row; width : 100%; height : 10%;'>
            <div style="height:100%; width:100%; border:solid; display : table-cell;">
                blah
            </div>
        </div>
        
        <div style='display : table-row; width : 100%; height : 50%;'>
            <div style="height:100%; width:100%; border:solid; display : table-cell;">
                hah
            </div>
        </div>
        
    </div>
</body>
</html>

最佳答案

试试这个代码..

示例链接在这里:FIDDLE

HTML 代码:

<html>
<body style="position:fixed; top:0px; left:0px;bottom:0px; right:0px;  margin:0px;">
    <div style='display : table; width : 100%; height : 100%'>

        <div style='display : table-row; width : 100%; height : 70%;'>
            <div style="height:70%; width:100%; border:solid; display : table-cell;">
                blah
            </div>
        </div>

        <div style='display : table-row; width : 100%; height : 30%;'>
            <div style="height:30%; width:100%; border:solid; display : table-cell;">
                hah
            </div>
        </div>

    </div>
</body>
</html>

希望这段代码对您有所帮助,如果您有任何疑问,请告诉我...

关于html - 按百分比调整表格行不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21901027/

相关文章:

php - 如何使用 '$row' 将一个数据库表中的特定值插入到另一个数据库表中?

javascript - 如何将复选框值作为数组?

javascript - 使用 base64 在 HTML 上渲染图像?

php - 'www' 文件夹和 'htdocs' 文件夹有什么区别?

jquery - 试图将我的 UL 的一部分向左移动

javascript - Vis Graph Library,Twitter Bootstrap 的响应式设计问题

html - 对齐 3 个 <div> 容器?

html表格背景不显示?

HTML5 Canvas 、shadowColor 和 shadowBlur

c# - Internet Explorer 8中的“This webpage could not be saved”错误