How to make a horizontal scroll when minifying window?

64 views Asked by At

How to make a horizontal scroll when minifying window? I made overflow-x in body, but there is no horizontal scrolling and elements shifted - I need no shift. Link to html and css with images: https://drive.google.com/drive/folders/0ByQHLazSsLs-dF9TbzJUcWdSVms?usp=sharing

2

There are 2 answers

0
Nitheesh On BEST ANSWER

Just set the width of the body tag and apply overflow-x: scroll;

body{
    overflow-x: scroll;
    width: 1200px;
}

I hope this will work fine for you.

0
xtricate On

You may need to wrap the the elements in a div and then use a media query.

CSS3 has @media queries that will change the way your HTML behaves at certain screen sizes.

body {
      width:95%;
      height500px;
      background-color: lightgreen;
}
div {
     width: 100px;
     background: lightblue;
  }

@media screen and (max-width: 768px) {
    body {
        background-color: lightgreen;
        
      
    }
  div {
     width: 800px;
     background: lightblue;
     overflow-x:scroll;
  }
}
<div>
  asdfas
  </div>