JavaScript for responsive layout is this ok or how to replace it with CSS?

  • 0
    Hello, in general I am learning to make responsive design and I have a seemingly easy task,
    make the buttons wrap to another line if the screen height is greater than the width.

    But the bottom line is that I'm making a website that will look the same on 8K monitors and on
    usual fullhd, but I can't figure out how to do this stuff without JS (resize the window so that the height was more than width)

    I also want to know if website adaptation via JS will greatly affect performance
    JavaScript Anonymous, Jul 1, 2019

  • 1 Answers
  • 0
    This is done via a media query in CSS.

    @media (orientation: portrait) {


Your Answer
To place the code, please use CodePen or similar tool. Thanks you!