Edit This Code:
<!DOCTYPE html>
<html>
<head>
<style>
#div1 {
    position: absolute;
    left: 50px;
    width: calc(100% - 100px);
    border: 1px solid black;
    background-color: yellow;
    padding: 5px;
    text-align: center;
}

</style>
</head>
<body>

<p>Create a div that stretches across the window, with a 50px gap between both sides of the div and the edges of the window:</p>
<div id="div1">Some text...</div>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy