Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 防止填充变形div_Html_Css - Fatal编程技术网

Html 防止填充变形div

Html 防止填充变形div,html,css,Html,Css,我有很多文本要放在一个小的框中,所以我没有太多的空间,而且大小非常精确 这是我的密码: <div class="myBox">Box</div> <style> .myBox{ width:100%; height:100%; padding:6px; } </style> 框 .我的盒子{ 宽度:100%; 身高:100%; 填充:6px; } 我不希望填充物使我的盒子变形

我有很多文本要放在一个小的
框中,所以我没有太多的空间,而且大小非常精确

这是我的密码:

<div class="myBox">Box</div>

<style>

    .myBox{
        width:100%;
        height:100%;
        padding:6px;
    }

</style>
框
.我的盒子{
宽度:100%;
身高:100%;
填充:6px;
}
我不希望填充物使我的盒子变形。


我无法更改宽度和高度属性。添加以下属性:

box-sizing: border-box;

这将改变默认的
内容框
,其宽度仅基于内容<代码>边框框的宽度和高度包括内容、
填充和边框(但不是
边距
)大小。

这与php无关。。。