CSS image Gallery



The image Gallery is used to store and display collection of images.

Example

<!DOCTYPE html>
    <html>
    <head>
    <style>
    div.gallery {
      margin: 5px;
      border: 1px solid red;
      float: left;
      width: 200px;
    }
    
    div.gallery:hover {
      border: 1px solid pink;
    }
    
    div.gallery img {
      width: 100%;
      height: auto;
    }
    
    div.one {
      padding: 15px;
      text-align: center;
    }
    </style>
    </head>
    <body>
    
    <div class="gallery">
      <a target="_blank" href="code.png">
        <img src="code.png" alt="Cinque Terre" width="600" height="400">
      </a>
      <div class="one">Add a description of the image here</div>
    </div>
    
    <div class="gallery">
      <a target="_blank" href="gradent.png">
        <img src="gradent.png" alt="Forest" width="600" height="400">
      </a>
      <div class="one">Add a description of the image here</div>
    </div>
    
    <div class="gallery">
      <a target="_blank" href="code.png">
        <img src="code.png" alt="Northern Lights" width="600" height="400">
      </a>
      <div class="one">Add a description of the image here</div>
    </div>
    
    <div class="gallery">
      <a target="_blank" href="gradent.png">
        <img src="code.png" alt="Mountains" width="600" height="400">
      </a>
      <div class="one">Add a description of the image here</div>
    </div>
    
    </body>
    </html>
    


Click on the "Run This Code" button to see how it works.





CSS

Welcome CSS Syntax CSS Selectors CSS ADD css CSS Borders CSS Backgrounds CSS Colors CSS Padding CSS Margin CSS Fonts CSS Text CSS Outline CSS Box-Model CSS Height&Width CSS Icons CSS Links CSS Lists CSS Display CSS Tables CSS Position CSS Overflow CSS Align CSS Float CSS Inline-block CSS Opacity CSS Image-Gallery CSS Navigation Bar CSS Dropdowns CSS Cursors CSS Forms CSS Pseudo-classes CSS Pseudo-elements

CSS3 FEATURES

CSS Gradients CSS shadows CSS 2D Transforms CSS 3D Transforms CSS Animations CSS Media Queries CSS Flexbox CSS important CSS Units