File tree Expand file tree Collapse file tree 2 files changed +41
-14
lines changed Expand file tree Collapse file tree 2 files changed +41
-14
lines changed Original file line number Diff line number Diff line change 11
11
</ head >
12
12
13
13
< body >
14
- < p > I'm extremely simple</ p >
14
+ < div >
15
+ < img src ="./big.jpeg " alt ="big-retro " />
16
+ </ div >
15
17
</ body >
16
18
</ html >
Original file line number Diff line number Diff line change @@ -4,22 +4,47 @@ content:'' - required
4
4
img --- does not work
5
5
*/
6
6
7
- p ::before {
8
- content : "hello world" ;
9
- font-size : 2rem ;
10
- color : blue;
11
- font-weight : 700 ;
7
+ div {
8
+ width : 70vw ;
9
+ /* border: 3px solid red; */
10
+ margin : 100px auto;
11
+ position : relative;
12
+ }
13
+
14
+ img {
15
+ width : 100% ;
12
16
display : block;
13
- background : yellow;
14
17
}
15
18
16
- p :: after {
19
+ div :: before {
17
20
content : "" ;
18
- font-size : 1rem ;
19
- color : red;
20
- font-weight : 700 ;
21
- background : greenyellow;
22
- display : block;
21
+ border : 2px solid grey;
22
+ box-sizing : border-box;
23
+ width : 100% ;
24
+ height : 100% ;
25
+ position : absolute;
26
+ top : -40px ;
27
+ left : -40px ;
28
+ z-index : -2 ;
29
+ transition : all 0.5s linear;
30
+ }
31
+
32
+ div ::after {
33
+ content : "" ;
34
+ background : rgba (128 , 128 , 128 , 0.5 );
35
+ /* background: grey; */
36
+ box-sizing : border-box;
23
37
width : 100% ;
24
- height : 3rem ;
38
+ height : 100% ;
39
+ position : absolute;
40
+ top : -20px ;
41
+ left : -20px ;
42
+ z-index : -1 ;
43
+ transition : all 0.5s linear;
44
+ }
45
+
46
+ div : hover ::before ,
47
+ div : hover ::after {
48
+ top : 0 ;
49
+ left : 0 ;
25
50
}
You can’t perform that action at this time.
0 commit comments