How do I use html to have scrolling images

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nicolat
    New Member
    • Nov 2013
    • 1

    How do I use html to have scrolling images

    I have a picture with a white box in the middle. The white box in the middle is where I would like the 5 images to continuously scroll/manually scroll between. Please can you help. Is this maybe a jquery task?
  • Exequiel
    Contributor
    • Jul 2012
    • 288

    #2
    Yes it is a jquery task,, you can search in google for scrollable images. .

    Comment

    • Sherin
      New Member
      • Jan 2020
      • 77

      #3
      Try This Code

      Code:
      <html>
      <head>
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <style>
      body, html {
        height: 100%;
        margin: 0;
        font-family: Arial, Helvetica, sans-serif;
      }
      
      * {
        box-sizing: border-box;
      }
      
      .bg-image {
        /* Full height */
        height: 50%; 
        
        /* Center and scale the image nicely */
        background-position: center;
        background-repeat: no-repeat;
        background-size: cover;
      }
      
      /* Images used */
      .img1 { background-image: url("img_snow.jpg"); }
      .img2 { background-image: url("img_girl.jpg"); }
      .img3 { background-image: url("img_lights.jpg"); }
      .img4 { background-image: url("img_nature.jpg"); }
      .img5 { background-image: url("img_forest.jpg"); }
      .img6 { background-image: url("img_woods.jpg"); }
      
      /* Position text in the middle of the page/image */
      .bg-text {
        background-color: rgb(0,0,0); /* Fallback color */
        background-color: rgba(0,0,0, 0.4); /* Black w/opacity/see-through */
        color: white;
        font-weight: bold;
        font-size: 80px;
        border: 10px solid #f1f1f1;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 2;
        width: 300px;
        padding: 20px;
        text-align: center;
      }
      </style>
      </head>
      <body>
      
      <div class="bg-image img1"></div>
      <div class="bg-image img2"></div>
      <div class="bg-image img3"></div>
      <div class="bg-image img4"></div>
      <div class="bg-image img5"></div>
      <div class="bg-image img6"></div>
      
      <div class="bg-text">TEXT</div>
      
      </body>
      </html>

      Comment

      • astinzz
        New Member
        • Oct 2020
        • 2

        #4
        es it is a jquery task,, you can search in google for scrollable images. .

        Comment

        Working...