Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Neon Pink responsive stat preview card

Simon 100

@Oldault

Desktop design screenshot for the Stats preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


-I couldn't find a way to make the desktop sized webpage responsive, so I improvized and made the mobile version expand; instead of making large webpage shrink. -I had a hard time figuring out how to change the picture based on the size, so i just used the desktop version of the picture on the mobile style. -I still don't know how to change that grey picture to a different colour using code. So i went ahead and modified it using PhotoShop (+Added bonus to the girls laptop) -The webpage isn't responsive when you higly alter the height of the webpage. It can support the width changes but when you start converting the heigh, it doesn't adjust. -I find that the margin is way too big between ~500-350px width, and i dont know how to change it. -It isn't responsive past 250px width for some reason.

Community feedback

@SeyBoo

Posted

Hi Monkey Man,

Quick note but 250 px is very small and no modern phone will every have such a small screen so don't worry about it.

For the background image, you can add a color to it this way, background: rgb(126, 85, 85, .5) url(http://placekitten.com/320/160); You just need to slow down the opacity of the color

And to change the picture based on the size you have two way

  • Using img tag :
// HTML

<img src="#" alt="#" class="desktop" />
<img src="#" alt="#" class="mobile" />

// CSS 

.desktop {
display:none;
}

@media (min-width:1024px) {
.mobile {
display:none;
}
.desktop {
display:block;
}
}
  • Background Image
//CSS
background: rgb(126, 85, 85, .5) url(http://placekitten.com/320/160);

@media (min-width:1024px)
{
background: rgb(126, 85, 85, .5) url(url for dekstop);
}
1
IRVINE MESA 1,855

@DrMESAZIM

Posted

Hi Simon

I did YouTube video on this challenge here is the link

https://www.youtube.com/watch?v=io2zNFSxk7o

Hopefully It will give you some guidance on use of media queries

in you challenge to change images for different sixes i would add this code inside file style.css on line 40

img {background-image: url(images/image-header-mobile.jpg);}

@media(min-width: 600px){ .img {background-image: url(images/image-header-desktop.jpg);} }

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord