1

I'm trying to move my absolute element closer to the left when I make screen smaller. And at the same time lower from the top.

img {
position: absolute;
top: -11vw;
left: < I don't know what to use to increase this value when screen becomes smaller>;
width: 130%;
min-width: size(500);     
}
Rurohi53
  • 122
  • 1
  • 8
  • Does this answer your question? [Bigger fonts on smaller screens without @media queries or javascript?](https://stackoverflow.com/questions/35978790/bigger-fonts-on-smaller-screens-without-media-queries-or-javascript) – L777 Sep 01 '21 at 20:01
  • 1
    Your post and your code comment contradict each other. Do you want it closer or farther from the left for smaller screens? – isherwood Sep 01 '21 at 20:39

1 Answers1

0

You need to use media queries.

/* XS Screen */
  img {
    position: absolute;
    top: -11vw;
    left: 10vw;
    width: 130%;
    min-width: size(500);     
}

  /* MD Screen */
  @media (min-width: 768px) {
    img {
      position: absolute;
      top: -11vw;
      left: 5vw;
      width: 130%;
      min-width: size(500);     
    }
}
bad_coder
  • 11,289
  • 20
  • 44
  • 72