Bootstrap 3 Horizontal scrollable row Website Design

后端 未结 1 481
星月不相逢
星月不相逢 2021-02-04 18:27

I am trying to make a horizontal scroll web page using bootstrap 3. This is what I have tried so far.

@media (min-width:768px) {
.container {
width:100%;
}
#mai         


        
1条回答
  •  野性不改
    2021-02-04 19:10

    Finally, I was able to get what I wanted through a CSS-only method.

    @media (min-width:768px) {
      .container{
        width:100%;
      }
      #main-content{
        min-height: 100%;
        height: auto;
      }
      #main-content > .row {
        overflow-x:scroll;
        overflow-y:hidden;
        white-space:nowrap;
      }
      #main-content > .row [class*="col-lg"], #main-content > .row [class*="col-md"], #main-content > .row [class*="col-sm"] {
        float:none;
        display:inline-block;
        white-space:normal;
        vertical-align:top;
      }
    }
    

    Added float:none and display:inline-block to col- classes to get it to work.

    You can see the working example here. I added niceScroll() to get the perfect look. Edit is here.

    0 讨论(0)
提交回复
热议问题