File tree 2 files changed +53
-0
lines changed
2 files changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en " dir ="ltr ">
3
+ < head >
4
+ < meta charset ="utf-8 ">
5
+ < title > </ title >
6
+ < link rel ="stylesheet " href ="styles.css ">
7
+ </ head >
8
+ < body >
9
+ < div class ="card bg-blur ">
10
+ < h1 > Card with Gradient Background</ h1 >
11
+ </ div >
12
+ </ body >
13
+ </ html >
Original file line number Diff line number Diff line change
1
+ : root {
2
+ --bg-image : url ('https://images.unsplash.com/photo-1538370965046-79c0d6907d47?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1169&q=80' );
3
+ }
4
+
5
+ body {
6
+ background-color : # 1D1E22 ;
7
+ font-family : sans-serif;
8
+ display : flex;
9
+ }
10
+
11
+ .card {
12
+ margin : auto;
13
+ padding : 1rem ;
14
+ height : 300px ;
15
+ width : 300px ;
16
+ text-align : center;
17
+ color : white;
18
+ display : flex;
19
+ align-items : center;
20
+ justify-content : center;
21
+ position : relative;
22
+ background-color : gray;
23
+ border-radius : 10px ;
24
+ }
25
+
26
+ .bg-blur {
27
+ overflow : hidden;
28
+ background-color : transparent;
29
+ }
30
+
31
+ .bg-blur ::before {
32
+ content : '' ;
33
+ background-image : var (--bg-image );
34
+ background-size : cover;
35
+ height : 100% ;
36
+ width : 100% ;
37
+ position : absolute;
38
+ filter : blur (30px );
39
+ z-index : -1 ;
40
+ }
You can’t perform that action at this time.
0 commit comments