File tree Expand file tree Collapse file tree 3 files changed +25
-12
lines changed Expand file tree Collapse file tree 3 files changed +25
-12
lines changed Original file line number Diff line number Diff line change 4
4
< meta charset ="UTF-8 " />
5
5
< meta http-equiv ="X-UA-Compatible " content ="IE=edge " />
6
6
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
7
- < title > CSS Box Model </ title >
7
+ < title > Display Property </ title >
8
8
9
9
<!-- Stylesheet -->
10
10
< link rel ="stylesheet " href ="./styles.css " />
11
11
</ head >
12
12
13
13
< body >
14
- < h2 > hello world</ h2 >
15
- < h2 > hello world</ h2 >
16
- < h2 > hello world</ h2 >
17
- < h2 > hello world</ h2 >
18
- < h2 > hello world</ h2 >
19
- < h2 > hello world</ h2 >
20
- < h2 > hello world</ h2 >
21
- < h2 > hello world</ h2 >
14
+ <!-- Block elements -->
15
+ < div class ="block "> I'm a block element</ div >
16
+ < h1 class ="block "> I'm a block element</ h1 >
17
+ < p class ="block "> I'm a block element</ p >
18
+
19
+ <!-- Inline elements -->
20
+ < span class ="inline "> I'm an inline element</ span >
21
+ < a class ="inline "> I'm an inline element</ a >
22
+ < img src ="./smoothie.jpg " alt ="smoothie " width ="100 " class ="inline " />
22
23
</ body >
23
24
</ html >
Original file line number Diff line number Diff line change 1
1
/*
2
- Border Hack - to troubleshoot layout
2
+ ELEMENTS HAVE IT SET BY DEFAULT
3
+ BLOCK : Always starts a new line and spans full width
4
+ INLINE : Does not start a new line and spans only content
3
5
*/
4
6
5
- * {
6
- border : 2px solid red;
7
+ .block {
8
+ background : blue;
9
+ color : white;
10
+ display : block;
11
+ display : inline;
12
+ }
13
+
14
+ .inline {
15
+ background : red;
16
+ color : white;
17
+ display : inline;
18
+ display : block;
7
19
}
You can’t perform that action at this time.
0 commit comments