ตัว #frame ไม่ต้องกำหนดทั้งความกว้างความสูง
ใส่ position: absolute แล้วกำหนด top,bottom,left,right ให้เป็น ค่าตามที่อยากให้เว้นขอบ
ใช่แบบนี้ปะที่อยากได้
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test</title>
<style>
body{
background-color: #532;
}
#frame{
position: absolute;
top: 10px;
bottom: 10px;
left: 10px;
right: 10px;
background-color: #f00;
border: 3px dashed #ff0;
}
</style>
</head>
<body>
<div id="frame"></div>
</body>
</html>