|
效果1演示:
代码:
- <!DOCTYPE html>
- <html>
- <head>
- <style>
- p {
- margin: 0;
- padding: 0;
- }
- .box-card {
- display: inline-block;
- position: relative;
- width: 300px;
- height: 300px;
- margin: 18px;
- overflow: hidden;
- box-sizing: border-box;
- box-shadow: 0px 0px 12px rgba(0, 0, 0, .2);
- }
- .box-card__img {
- width: 100%;
- height: 100%;
- transition: 0.5s;
- }
- .box-card__img img {
- width: 100%;
- height: 100%;
- }
- .box-card__content {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- padding: 100px 20px 10px;
- transform: translateY(100%);
- box-sizing: border-box;
- font-size: 14px;
- text-align: center;
- background-image: linear-gradient(135deg, #FFA8A8 10%, #FCFF00 100%);
- color: #000;
- opacity: 0;
- transition: 0.5s;
- }
- .box-card:hover .box-card__img {
- position: relative;
- transform: scale(0.3) translateY(-110%);
- border: 6px solid rgba(255, 255, 255, 0.9);
- z-index: 9;
- }
- .box-card:hover .box-card__content {
- transform: translateY(0px);
- opacity: 1;
- }
- </style>
- </head>
- <body>
- <div class="box-card">
- <div class="box-card__img">
- <img src="./img/img3.jpeg" />
- </div>
- <div class="box-card__content">
- <h3>简介</h3>
- <div>
- <p>姓名:前端技术营;年龄:永远18岁(在二进制世界里);联系方式:10101010(请自行转换为十进制);技能亮点:精通Java(能写出让编译器都颤抖的代码)、JavaScript(能让浏览器怀疑人生)、Python(让代码像蛇一样灵活,但绝不咬人)
- </p>
- </div>
- </div>
- </div>
- </body>
- </html>
复制代码 效果2演示:
代码:
|
|