HTML & CSS Web Design
Html Css > Code Examples
Absolute container and absolute children
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Absolute container and absolute children
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>CSS Positioning Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style rel="stylesheet" type="text/css">
div,h1,p {
border: 1px solid #FF00FF;
margin: 4px;
background-color: #ffffff;
}
div {
width: 400px;
height: 160px;
}
div#page1 {
position: absolute;
top: 20px;
left: 20px;
}
p.paragraph1 {
position: absolute;
top: 40px;
left: 20px;
width: 300px;
}
p.paragraph2 {
position: absolute;
top: 90px;
left: 20px;
width: 300px;
}
</style>
</head>
<body>
<div id="page1">
<h1>CSS Positioning Example</h1>
<p class="paragraph1">This is paragraph one. <br><br>
Truly love you endlessly.<br>
Every day without you is like a book without pages.<br>
I love you, I will always do, for the rest of our earthly and heavenly life.<br>
<br><br>
F. Abahusain
</p>
<p class="paragraph2">This is paragraph two.</p>
</div>
</body>
</html>