-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCSS Exemplo Positioning.html
More file actions
61 lines (61 loc) · 965 Bytes
/
Copy pathCSS Exemplo Positioning.html
File metadata and controls
61 lines (61 loc) · 965 Bytes
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
58
59
60
61
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Posicionando Elementos</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
h1 {
margin-bottom: 15px;
}
div#container {
background-color: #00FFFF;
position: relative;
top: 60px;
}
p {
width: 50px;
height: 50px;
border: 1px solid black;
margin-bottom: 15px;
}
#p1 {
background-color: #A52A2A;
position: relative;
top: 65px;
left: 65px;
}
#p2 {
background-color: #DEB887;
position: relative;
top: 65px;
left: 65px;
}
#p3 {
background-color: #5F9EA0;
position: relative; /* com posição absoluta ele perde o lugar dele, o div azul passa a ocupar o espaço dele*/
top: 65px;
left: 65px;
}
#p4 {
background-color: #FF7F50;
position: relative;
top: 65px;
left: 65px;
}
</style>
</head>
<body>
<h1>Posicionando Elementos</h1>
<div id="container">
<p id="p1"></p>
<p id="p2"></p>
<p id="p3"></p>
<p id="p4"></p>
</div>
</body>
</html>