/* Slideshow container */ .slideshow-container { width: 1000px; height: 600px; position: relative; margin: auto; }

/* Slides */ .slide { display: none; }

/* Next and previous buttons */ .prev, .next { cursor: pointer; position: absolute; top: 50%; width: auto; margin-top: -22px; padding: 16px; color: white; font-weight: bold; font-size: 18px; transition: 0.6s ease; border-radius: 0 3px 3px 0; }

/* Position the "next button" to the right */ .next { right: 0; border-radius: 3px 0 0 3px; }

/* On hover, add a black background color with a little bit see-through */ .prev:hover, .next:hover { background-color: rgba(0,0,0,0.8); }

/* Dots container */ .dots-container { text-align: center; margin-top: 20px; }

/* The dots/bullets */ .dot { cursor: pointer; height: 15px; width: 15px; margin: 0 5px; background-color: #bbb; border-radius: 50%; display: inline-block; transition: background-color 0.6s ease; }

/* Add a background color to the active dot */ .active, .dot:hover { background-color: #717171; }

/* Caption text */ .text { color: #f2f2f2; font-size: 15px; padding: 8px 12px; position: absolute; bottom: 8px; width: 100%; text-align: center; }

其中,'.slideshow-container' 和 '.dots-container' 分别是轮播图容器和轮播图下方的圆点容器,'.slide' 是轮播图中的每一张图片。'.prev' 和 '.next' 分别是轮播图左右两侧的箭头按钮。'.dot' 是轮播图下方的圆点。'.active' 是当前轮播图所对应的圆点。'.text' 是轮播图中的文字说明。

HTML & CSS 轮播图:分离样式,1000px 宽度,600px 高度

原文地址: https://www.cveoy.top/t/topic/oJCg 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录