-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCSS-float.html
88 lines (83 loc) · 1.67 KB
/
CSS-float.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
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CSS Float</title>
<style>
code {
color: white;
background: cadetblue;
border-radius: 5px;
display: block;
padding: 25px 15px;
text-align: center;
}
header,
section,
aside,
footer {
margin: 0 1.5% 24px 1.5%;
}
section {
float: left;
width: 63%;
}
aside {
float: right;
width: 30%; /*always set a width on floated items*/
}
footer {
clear: both;
/*Clearing floats is accomplished using the clear property,must use it after floating element*/
margin-bottom: 0;
}
.section2 {
float: left;
width: 30%;
}
</style>
</head>
<body>
<header>
<code><header></code>
</header>
<section>
<code
><section> <br />
float: left;</code
>
</section>
<aside>
<code
><aside> <br />
float: right;</code
>
</aside>
<br />
<section class="section2">
<code
><section> <br />
float: left;</code
>
</section>
<section class="section2">
<code
><section> <br />
float: left;</code
>
</section>
<section class="section2">
<code
><section> <br />
float: left;</code
>
</section>
<footer>
<code
><footer> <br />
Clear:Both
</code>
</footer>
</body>
</html>