Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.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居中,左、右、上、下各5倍边距_Html_Css - Fatal编程技术网

Html Div居中,左、右、上、下各5倍边距

Html Div居中,左、右、上、下各5倍边距,html,css,Html,Css,我想制作一个居中(水平和垂直)的div。它应该随着屏幕的变化而改变大小,但周围有5个像素的边距 #thediv { position: absolute; top: 10px; right: 10px; bottom: 10px; left: 10px; }

我想制作一个居中(水平和垂直)的div。它应该随着屏幕的变化而改变大小,但周围有5个像素的边距

#thediv {
    position: absolute;
    top: 10px;
    right: 10px;
    bottom: 10px;
    left: 10px;
}