@mtf/

position test bed

HTML, CSS, JS

Wrestling with position property

fork
loading
Files
  • index.html
  • script.js
  • style.css
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>repl.it</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
  </head>
  <body>
    <section class="parent">
      <pre class="child">
        <code>
    .parent {
      position: relative;
      margin-top: 5px;
      margin-left: 10px;
      border: 1px solid red;
      background: rgb(0, 128, 128, 0.1);
    }
        </code>
      </pre>
      <aside class="test">
        <span>abc</span>
      </aside>
    </section>
    <article>
      <h1>A quick brown fox jumps over the lazy dog!</h1>
    </article>
    <script src="script.js"></script>
  </body>
</html>
result
console