HTML-CSS照片墙

照片墙

效果网址:https://penghongfu.github.io/

图片在img文件夹下


<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>照片墙title>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }

        body {
            background-color: #eeeeee;
        }

        #container {
            width: 960px;
            height: 450px;
            margin: 60px auto;
            position: relative;
        }

        .pic {
            width: 250px;
        }

        #container img:hover {
            box-shadow: 15px 15px 20px rgba(50, 50, 50, 0.4);
            transform: rotate(0deg) scale(1.20);
            -webkit-transform: rotate(0deg) scale(1.20);
            z-index: 2;
        }

        #container img {
            padding: 10px 10px 15px;
            background: white;
            border: 1px solid #dddddd;
            box-shadow: 2px 2px 3px rgba(50, 50, 50, 0.4);
            -webkit-transition: all 0.5s ease-in;
            -moz-transition: all 0.5s ease-in;
            -ms-transition: all 0.5s ease-in;
            -o-transition: all 0.5s ease-in;
            transition: all 0.5s ease-in;
            position: absolute;
            z-index: 1;
        }

        /*第一张图片*/
        .pic1 {
            left: 400px;
            top: 0;
            transform: rotate(-5deg);
            -webkit-transform: rotate(-5deg);
            -moz-transform: rotate(-5deg);
            -o-transform: rotate(-5deg);
        }

        .pic2 {
            left: 200px;
            top: 0;
            transform: rotate(-20deg);
            -webkit-transform: rotate(-20deg);
        }

        .pic3 {
            left: 0;
            right: 0;
            transform: rotate(5deg);
            -webkit-transform: rotate(5deg);
        }

        .pic4 {
            bottom: 200px;
            left: 500px;
            transform: rotate(-5deg);
            -webkit-transform: rotate(-5deg);
        }

        .pic5 {
            right: 100px;
            top: 0;
            transform: rotate(5deg);
            -webkit-transform: rotate(5deg);
        }

        .pic6 {
            left: 800px;
            top: 0;
            transform: rotate(10deg);
            -webkit-transform: rotate(10deg);
        }
    style>
head>
<body>
    <div id="container">
        <img class="pic pic1" src="img/1.jpg">
        <img class="pic pic2" src="img/2.jpg">
        <img class="pic pic3" src="img/3.jpg">
        <img class="pic pic4" src="img/4.jpg">
        <img class="pic pic5" src="img/5.jpg">
        <img class="pic pic6" src="img/6.jpg">
    div>
body>
html>

你可能感兴趣的:(图片,HTML,CSS)