如果这样的结构如何实现效果
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>CSS实现图片滑动</title> <meta name="generator" content="EverEdit" /> <meta name="author" content="" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> <link rel="stylesheet" href="1.css" type="text/css" media=""/> </head> <body> <header> <h1>SLIDING IMAGE PANELS <span>WITH CSS3</span></h1> <nav> <a href="index1.html">Demon 1</a> <a href="index2.html">Demon 2</a> <a href="index3.html">Demon 3</a> <a href="index4.html">Demon 4</a> </nav> </header> <section> <div> <label for="img-1">1</label> <input type="radio" name="radio-set" id="img-1"> <div></div> <div></div> <div></div> <div></div> </div> <div> <label for="img-2">2</label> <input type="radio" name="radio-set" id="img-2"> <div></div> <div></div> <div></div> <div></div> </div> <div> <label for="img-3">3</label> <input type="radio" name="radio-set" id="img-3"> <div></div> <div></div> <div></div> <div></div> </div> <div> <label for="img-4">4</label> <input type="radio" name="radio-set" id="img-4"> <div></div> <div></div> <div></div> <div></div> </div> </section> </body> </html>
section { width: 600px; height: 400px; border: 20px solid #fff; box-shadow: 1px 1px 3px rgba(0,0,0,.1); margin: 0 auto; text-align: center; position: relative; font-family: Cambria, Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, serif; } section > div{ height: 400px; width: 150px; float: left; position: relative; } section > div > label { display: block; width: 150px; height: 30px; margin-top: 350px; font-style: italic; font-size: 20px; color: #fff; line-height: 30px; position: relative; z-index: 1000; } section > div > label::before { content: ""; display: block; height: 34px; width: 34px; border-radius: 50%; background-color: rgba(130,195,217,0.9); position: absolute; left: 50%; top: 50%; margin-top: -17px; margin-left: -17px; z-index: -1; box-shadow: 0px 0px 0px 4px rgba(255,255,255,0.3); } section > div:not(:nth-of-type(4)) > label::after{ content: ""; display: block; width: 1px; height: 400px; background-color: #fff; position: absolute; right: 0px; bottom: -20px; } section > div > input { display: none; }
就是切换图片的那个section ,我个人比较喜欢清晰点的结构,但是写到图片转换这块就没思路了。。
47
收起
正在回答 回答被采纳积分+1
1回答
HTML5与CSS3实现动态网页 2018
- 参与学习 1887 人
- 提交作业 4643 份
- 解答问题 5760 个
有HTML和CSS基础,却不知道如何进阶?本路径带你通过系统学习,完成从“会做网页”到“做出好的动态网页”的蜕变,迈出成为前端工程师的第一步。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星