forked from itscodenation/flw1-u1l2-23-24-student-exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gallery.css
76 lines (66 loc) · 1.84 KB
/
gallery.css
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
71
72
73
74
75
76
body {
font-family: Arial, sans-serif;
background-color: #f2f2f2;
margin: 0;
padding: 20px;
}
/* 4. Style the product gallery using flexbox. */
.product-gallery {
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
align-content: flex-start;
}
/* 5. Style the div with the class "product-card" using the box model. */
/* 6. Add a solid border with any color you like. */
/* 7. Add background color of white. */
.product-card {
max-width: 200px;
display: box;
background-color: #fff;
margin: 5px;
padding: 15px;
border: 5px;
border-style: solid;
border-color: #43bad3;
}
.on-sale {
background-color: #43bad3;
}
.on-sale::before {
align-content: flex-start;
content: url('https://www.copydirect.co.nz/site/copydirectltd/images/Sale%20Signs/3-x-Sales-Posters-A2V1-200px.png');
display: inline-flex;
width: 200px;
}
.product-card:hover{
border-color: #f762a2;
}
.product-image {
max-width: 200px;
display: block;
margin: 0 auto 10px;
}
.product-name {
max-width: 200px;
color: #333;
margin-bottom: 10px;
}
.product-desc {
max-width: 200px;
color: #666;
font-size: 14px;
margin-bottom: 10px;
}
.product-price {
max-width: 200px;
color: #7962ff;
font-weight: bold;
}
/* Spicy Tasks (note: you may need to search for resources to complete these)
1. Add hover effects on the product card, like changing the background color or transforming its scale.
2. Adjust the layout to show 2 or 4 products per row.
3. Explore the "align-items" and "align-content" flexbox properties and see how they change the product gallery layout.
4. Introduce a class for "on-sale" products and style them differently.
5. Add a "Sale" badge on top of the product image for items on sale using pseudo-elements (::before or ::after).
*/