Untitled

mail@pastecode.io avatar
unknown
html
a year ago
1.1 kB
1
Indexable
Never
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .container {
            padding: 20px;
            margin: 50px;
            border: 5px solid black;
        }
        .box {
            padding: 20px;
            background-color: rgb(0,170,110);
            position: fixed;
            left: 100px;
            top: 250px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>CSS Positions</h1>
        <p>The position property defines how an element will be positioned on a page.</p>
    </div>
    <div class="container">
        <div class="box">
            <h2>Static Positioning</h2>
            <p>A static positioned element is always positioned according to the normal flow of the page. HTML Elements are positioned static by default. Static positioned elements are not affected by the top, bottom, left, right and z-index properties.</p>
        </div>
    </div>
</body>
</html>