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

All comments

  • P
    Vivek 150

    @tweetandcode

    Posted

    Hey saw your solution, looks great.

    One suggestion, instead of <img> tag, try <picture> tag, this will load only one of the two images(depending on if it is a mobile or desktop).

    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture.

    Hope this helps.

    Marked as helpful

    1
  • P
    Vivek 150

    @tweetandcode

    Posted

    Hi, I'll try to get you started in a simple way. open your css file and add this body { background: white; } @media screen and (min-width: 768px) { body { background: red; } }

    resize your browser to <= 768px to see the body go to white and >= 768px to see it become red.

    also remember this. min-width means if the screen is atleast(>=) that width, apply the css inside. max-width means if the screen is atmost(<=) that width, apply the css inside

    and place your media queries in the end.

    This should get you started. .

    0
  • P
    Vivek 150

    @tweetandcode

    Posted

    Looks great, responsive!.

    You can add this to make it even better,

    Right now it loads both the mobile image and the desktop image all the time. <picture> tag will just load one of them depending on the context.

    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture

    Hope this helped

    Marked as helpful

    1
  • P
    Vivek 150

    @tweetandcode

    Posted

    Looks good, this is an interesting approach setting the image as background with css. have a look at the <picture> tag, you can do responsive images with just html.

    Marked as helpful

    0
  • P
    Vivek 150

    @tweetandcode

    Posted

    Two things, one of them I just learned yesterday, thanks to a comment.

    1. Start switching to mobile design at < 600px
    2. Use <picture> tag to load only one of the two images.

    Hope this helped.

    PS: The output looks good.

    1