Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the astra domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/sqrtyhjzaqx471/public_html/wp-includes/functions.php on line 6121
How to make horizontal scrollable div in a mobile view

Home Forums HTML How to make horizontal scrollable div in a mobile view

Viewing 0 reply threads
  • Author
    Posts
    • #107
      avi
      Participant

      Just try to apply flex none to the div to keep their size and a specify media query where you want desktop to start.

      .images {
          display: flex;
          align-items:center;
          background-color: #eee;
          padding: 1rem;
          overflow-x: scroll;
      }
      
      .images > div {
          flex: none;
          max-width: 100%;
          padding-left: 15px;
          padding-right: 15px;
      }
      
      .images img {
          max-width:100%;
          width: 100%;
      }
      
      @media (min-width: 960px) {
      
        .images {
           overflow-x: visible;
        }
      
        .images > div {
          flex-basis: 0;
          flex-grow: 1;
         }
      }
Viewing 0 reply threads
  • You must be logged in to reply to this topic.
Scroll to Top