-
Notifications
You must be signed in to change notification settings - Fork 0
/
07_float_align.html
83 lines (74 loc) · 2.34 KB
/
07_float_align.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Float & Align</title>
<style>
* {
/* don't add padding to width */
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
line-height: 1.4em;
}
/* containing all website contents and making it centered on the page with auto margins */
.container {
/* Use max-width instead of width to make responsive design for smaller screen sizes */
max-width: 960px;
margin: 30px auto;
}
.clr {
clear: both;
}
.box {
background: #f4f4f4;
border: 1px ridge #333;
padding: 20px;
margin-bottom: 15px;
}
.box p {
text-align: left;
text-align: justify;
}
#box-2 {
float: left;
width: 68%;
}
#box-3 {
float: right;
width: 30%;
}
</style>
</head>
<body>
<div class="container">
<div id="box-1" class="box">
<h3>Heading</h3>
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Exercitationem eaque ipsum autem asperiores earum unde fuga neque, commodi pariatur impedit!
</p>
</div>
<div id="box-2" class="box">
<h3>Heading</h3>
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Exercitationem eaque ipsum autem asperiores earum unde fuga neque, commodi pariatur impedit!
</p>
</div>
<div id="box-3" class="box">
<h3>Heading</h3>
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Exercitationem eaque ipsum autem asperiores earum unde fuga neque, commodi pariatur impedit!
</p>
</div>
<div class="clr"></div>
<div id="box-4" class="box">
<h3>Heading</h3>
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Exercitationem eaque ipsum autem asperiores earum unde fuga neque, commodi pariatur impedit!
</p>
</div>
</div>
</body>
</html>