1@media screen { h1#first { position: fixed; }}@media print { h1#first { position: static; }}
2
1<!doctype html>
2<html>
3<head>
4<title>ABSOLUTE POSITIONING</title>
5<link href="example1.css" rel="stylesheet">
6</head>
7<body>
8 <div class="a1">
9 <div class="a2"></div>
10 </div>
11</body>
12</html>
13
14<style>.a1 {
15 width:304px;
16 height:304px;
17 background-color:white;
18 border:3px solid blue;
19 text-align:center;
20 position:relative;
21}
22.a2 {
23 width:154px;
24 height:154px;
25 background-color:white;
26 border:3px solid orange;
27 text-align:center;
28 position:absolute;
29 top:100px;
30 left:40px;
31}
32</style>
33
1<div class=”parent”> <div class=”box” id=”one”>One</div> <div class=”box” id=”two”>Two</div> <div class=”box” id=”three”>Three</div> <div class=”box” id=”four”>Four</div></div>