@quijotexSubmitted over 1 year ago
How can I enhance my code? How can I write my code including good practices? How can I make my code cleaner and shorter?
How can I enhance my code? How can I write my code including good practices? How can I make my code cleaner and shorter?
Hello there, Congrulations for the amazing work! I have some tips for you for a cleaner code:
@media screen and (min-width: 576px) {
.main {
display: flex;
justify-content: center;
}
.main_div {
width: 65%;
height: 65%;
}
}
@media screen and (min-width: 768px) {
.main { // => NOT NEEDED
display: flex;
justify-content: center;
}
.main_div {
width: 40%;
}
}
When using queries, you do not need to apply same css on the rules apply at the same time, for example, at the 800 px width both of the queries apply so you do not need to apply same css rules for the main, you can just focus on different and more special css rules. I hope this helps! Good luck and good job!