This is my solution to the Product preview card component challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic real world projects.
Users should be able to:
- View the optimal layout depending on their device's screen size
- See hover and focus states for interactive elements
- Solution URL: Add solution URL here
- Live Site URL: Add live site URL here
I began with a just do it attitude, as we can see, it paid off. I surprised myself.
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
What have we learned?
The challenge didn't require any javascript however I personally wanted to have some more fun and add some myself, I found the code below to be quite interesting.
let button = document.querySelector('button');
function changeColor(event){
event.target.style.backgroundColor = "hsl(212, 21%, 14%)"
}
function returnColor(event){
event.target.style.backgroundColor = ''
}
button.addEventListener('mouseover', changeColor)
button.addEventListener('mouseout', returnColor)
We're going to use this website to get better at making even more impressive websites
- Example resource 1 - This helped me with getting an idea of what I was going to do with handling the font weights
- Website - UbaidRussell
- Frontend Mentor - @UbaidRussell
- Twitter - @ubaidrussell