-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCSS-inline-Block.html
70 lines (60 loc) · 1.49 KB
/
CSS-inline-Block.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Inline Block</title>
<style>
code {
color: greenyellow;
background: black;
display: block;
padding: 25px 15px;
border-radius: 10px;
text-align: center;
}
header,
section,
footer {
margin: 0 1.5% 24px 1.5%;
;
}
section {
display: inline-block;
width: 30%;
}
.bdr {
border-top-right-radius: 66px;
border-bottom-left-radius: 66px;
}
footer {
margin-bottom: 0;
}
</style>
</head>
<body>
<header>
<code><Header></code>
</header>
<section>
<code class="bdr">
¥Section¥ <br> Display: <br> Inline-Block;
</code>
</section><!--
--><section>
<code class="bdr">
¥Section¥ <br> Display: <br> Inline-Block;
</code>
</section><section> <!-- put each new <section> element’s opening tag on the same line as the previous <section> element’s closing tag => to remove space between inline-block elements-->
<code class="bdr">
¥Section¥ <br> Display: <br> Inline-Block;
</code>
</section>
<footer>
<code>
<Footer>
</code>
</footer>
<!-- Another way to remove the white space between inline-block elements is to open an HTML comment directly after an inline-block element’s closing tag.(see above) -->
</body>
</html>