@pradeeps4ini
Posted
Hi, Wallace. How are you?
I have some suggestions, i'd like to give.
-
Media query for "max-width:425px" is scaling down your card. You should remove it and change the value of other media query from 375px to 425px.
-
Use semantic markup for your HTML. You can wrap your card/main content in a <main> element and footer in <footer> element.
-
Make your CSS less repetitive using utility classes and custom variables. For example, you're using "display: flex;" on multiple elements. You can create a css declaration ".flex" and assign it to elements.
.flex { display: flex; }
Custom properties (CSS Variables) will help you to write a robust CSS. Suppose you are using a value on multiple properties. And in future you'll want to change the value. With variables, you'll have to change the value on the variable property only and not on all the other properties.
-
For different size of same image, you can use <picture> element. With it, you can change the size of image respective to the viewport width.
-
In the .price section. You're using <span> for the prices. <span> is used when we don't have a semantic element for a text. But here you could have used <p>.
-
In the CSS some selectors are too long, which increases the specificity of the selector.
.main_container .main_content .info_section .purchase {}
Here, you simply could've used ".purchase{}". And we still would've known that you're targeting an element with .purchase class. If you also want to convey the section of the element, then keep the CSS of each section together. And use comment to tell where the section style starts and ends.
Marked as helpful