Home > Web Front-end > CSS Tutorial > CSS implements image sorting similar to image galleries (complete code)

CSS implements image sorting similar to image galleries (complete code)

不言
Release: 2018-08-24 11:47:24
Original
2300 people have browsed it

The content of this article is about the CSS implementation of image sorting similar to image galleries (complete code). It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

<!DOCTYPE html >
<html>
    <head>
        <meta charset="utf-8"> 
        <title>自学教程(如约智惠.com)</title> 
        <style >
            div.img {
                margin:5px;
                border:1px solid #ccc;
                float:left;
                width:180px;
            }
            
            div.img:hover{
                border:1px solid #777;
            }
            
            div.img img {
                width: 100%;
                height: auto;
            }
 
            div.desc {
                padding: 15px;
                text-align: center;
            }
            
        </style>
    </head>
    <body>
        <div class="responsive">
          <div class="img">
            <a target="_blank" href="http://static.runoob.com/images/demo/demo1.jpg">
              <img src="http://static.runoob.com/images/demo/demo1.jpg" alt="图片文本描述" width="300" height="200">
            </a>
            <div class="desc">这里添加图片文本描述</div>
          </div>
        </div>
         
        <div class="responsive">
          <div class="img">
            <a target="_blank" href="http://static.runoob.com/images/demo/demo2.jpg">
              <img src="http://static.runoob.com/images/demo/demo2.jpg" alt="图片文本描述" width="300" height="200">
            </a>
            <div class="desc">这里添加图片文本描述</div>
          </div>
        </div>
         
        <div class="responsive">
          <div class="img">
            <a target="_blank" href="http://static.runoob.com/images/demo/demo3.jpg">
              <img src="http://static.runoob.com/images/demo/demo3.jpg" alt="图片文本描述" width="300" height="200">
            </a>
            <div class="desc">这里添加图片文本描述</div>
          </div>
        </div>
         
        <div class="responsive">
          <div class="img">
            <a target="_blank" href="http://static.runoob.com/images/demo/demo4.jpg">
              <img src="http://static.runoob.com/images/demo/demo4.jpg" alt="图片文本描述" width="300" height="200">
            </a>
            <div class="desc">这里添加图片文本描述</div>
          </div>
        </div>
    </body>
</html>
Copy after login

Related recommendations:

How to realize the animation effect of panorama in CSS3 (with code)

How to use pure CSS3 to achieve the effect of image carousel

The above is the detailed content of CSS implements image sorting similar to image galleries (complete code). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template