File tree Expand file tree Collapse file tree 2 files changed +31
-54
lines changed Expand file tree Collapse file tree 2 files changed +31
-54
lines changed Original file line number Diff line number Diff line change 12
12
13
13
< body >
14
14
< div class ="banner ">
15
- < h1 > hello world, I am using media queries in CSS</ h1 >
15
+ < img src ="./small.jpeg " alt ="small retro " class ="first-image " />
16
+ < img src ="./big.jpeg " alt ="big retro " class ="second-image " />
17
+ < img
18
+ src ="./images/folder-img.jpeg "
19
+ alt ="folder retro "
20
+ class ="third-image "
21
+ />
16
22
</ div >
17
23
</ body >
18
24
</ html >
Original file line number Diff line number Diff line change 1
1
/*
2
- Media Queries
3
- Responsive Design
4
- Style Elements on Different Screen Sizes
5
- min-width: --- starting from
6
- max-width: --- up to
7
- Mobile First
2
+ z-index --- z-axis
3
+ 0 - default
4
+ does not work on position:static;
8
5
*/
9
6
10
- body {
11
- background : yellow;
7
+ img {
8
+ width : 250px ;
9
+ height : 250px ;
10
+ position : absolute;
12
11
}
13
12
14
13
.banner {
15
- background : blue ;
16
- color : white ;
17
- text-align : center ;
18
- text-decoration : underline ;
19
- text-transform : capitalize ;
14
+ position : relative ;
15
+ border : 5 px solid red ;
16
+ width : 80 vw ;
17
+ height : 75 vh ;
18
+ margin : 50 px auto ;
20
19
}
21
20
22
- /* @media screen and (min-width: 576px) {
23
- body {
24
- background: blue;
25
- }
26
-
27
- .banner {
28
- background: yellow;
29
- color: black;
30
- font-size: 40px;
31
- }
21
+ .first-image {
22
+ top : 0 ;
23
+ left : 0 ;
24
+ z-index : 3 ;
32
25
}
33
26
34
- @media screen and (min-width: 776px) {
35
- body {
36
- background: green;
37
- }
38
-
39
- .banner {
40
- background: fuchsia;
41
- color: black;
42
- }
43
- } */
44
-
45
- @media screen and (max-width : 576px ) {
46
- body {
47
- background : blue;
48
- }
49
-
50
- .banner {
51
- background : yellow;
52
- color : black;
53
- }
27
+ .second-image {
28
+ top : 10% ;
29
+ left : 10% ;
30
+ z-index : 2 ;
54
31
}
55
32
56
- /* Larger max-width overrides other max-width */
57
- @media screen and (max-width : 776px ) {
58
- body {
59
- background : green;
60
- }
61
-
62
- .banner {
63
- background : fuchsia;
64
- color : black;
65
- }
33
+ .third-image {
34
+ top : 20% ;
35
+ left : 20% ;
36
+ z-index : -1 ;
66
37
}
You can’t perform that action at this time.
0 commit comments