RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / 问题 / 1541776
Accepted
The__Tip учусь
The__Tip учусь
Asked:2023-09-21 13:35:29 +0000 UTC2023-09-21 13:35:29 +0000 UTC 2023-09-21 13:35:29 +0000 UTC

如何使用纯 Html css 制作这样的滑块?

  • 772

[![

.slider{
width: 1366px;
height: 569px;
overflow: hidden;
}


.middle{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}



.navigation{
display: flex;
position: absolute;
left: 50%;
bottom: 10px;
transform: translateX(-50%);

}

.bar{
 border-radius: 50%;
 width:15px;
 height: 15px;
background-color: #000;
}
<div class="slider midlle">

  <div class="slides">
  <input type="radio" name="s" id="r1" checked>
  <input type="radio" name="s" id="r2">
  <input type="radio" name="s" id="r3">
  <input type="radio" name="s" id="r4">
  <input type="radio" name="s" id="r5">
  <input type="radio" name="s" id="r6">
  <input type="radio" name="s" id="r7">
  <input type="radio" name="s" id="r8">
  <input type="radio" name="s" id="r9">
  <input type="radio" name="s" id="r10">
  
  <div class="sllide"><img src="image/slider__bg.jpg" alt=""></div>
  <div class="sllide"><img src="image/slider__bg.jpg" alt=""></div>
  <div class="sllide"><img src="image/slider__bg.jpg" alt=""></div>
  <div class="sllide"><img src="image/slider__bg.jpg" alt=""></div>
  <div class="sllide"><img src="image/slider__bg.jpg" alt=""></div>
  <div class="sllide"><img src="image/slider__bg.jpg" alt=""></div>
  <div class="sllide"><img src="image/slider__bg.jpg" alt=""></div>
  <div class="sllide"><img src="image/slider__bg.jpg" alt=""></div>
  <div class="sllide"><img src="image/slider__bg.jpg" alt=""></div>
  <div class="sllide"><img src="image/slider__bg.jpg" alt=""></div>
  
  </div>
  
  <div class="navigation">
    <lable for="r1" class="bar"></lable>
    <lable for="r2" class="bar"></lable>
    <lable for="r3" class="bar"></lable>
    <lable for="r4" class="bar"></lable>
    <lable for="r5" class="bar"></lable>
    <lable for="r6" class="bar"></lable>
    <lable for="r7" class="bar"></lable>
    <lable for="r8" class="bar"></lable>
    <lable for="r9" class="bar"></lable>
    <lable for="r10" class="bar"></lable>
  </div>
  
  </div>

在此输入图像描述] 2 ] 2

css3
  • 1 1 个回答
  • 37 Views

1 个回答

  • Voted
  1. Best Answer
    Dark Space
    2023-09-21T14:03:09Z2023-09-21T14:03:09Z

    发生了一些事。我们需要查看 caniuse 来查看其他浏览器是否支持它,但在 Google 109 中它对我来说可以正常工作。

    https://codepen.io/andromeda3141/pen/XWoVgpe

    .container {
      padding: 2rem;
    }
    
    .slider-wrapper {
      position: relative;
      max-width: 48rem;
      margin: 0 auto;
    }
    
    .slider {
      display: flex;
      aspect-ratio: 16 / 9;
      overflow-x: auto;
      scroll-snap-type: x mandatory;
      scroll-behavior: smooth;
    }
    
    .slider img {
      flex: 1 0 100%;
      scroll-snap-align: start;
    }
    
    .slider-nav {
      display: flex;
      column-gap: 1rem;
      position: absolute;
      bottom: 1.25rem;
      left: 50%;
      transform: translateX(-50%);
      z-index: 1;
    }
    
    .slider-nav a {
      width: 0.5rem;
      height: 0.5rem;
      border-radius: 50%;
      background-color: #fff;
      opacity: 0.75;
    }
    
     ::-webkit-scrollbar {
      width: 0;
    }
    <section class="container">
      <div class="slider-wrapper">
        <div class="slider">
          <img src="https://shop-cdn1-2.vigbo.tech/shops/2544/products/16486697/images/3-9f0ed407d8ba2537f38b8b2d9765ccdb.jpg" alt="Картинка-1" id="slide-1">
          <img src="https://png.pngtree.com/thumb_back/fw800/background/20230408/pngtree-woods-sunshine-forest-nature-background-image_2173232.jpg" alt="Картинка-1" id="slide-2">
          <img src="https://png.pngtree.com/background/20230401/original/pngtree-forest-morning-background-picture-image_2251636.jpg" alt="Картинка-1" id="slide-3">
        </div>
        <div class="slider-nav">
          <a href="#slide-1"></a>
          <a href="#slide-2"></a>
          <a href="#slide-3"></a>
        </div>
      </div>
    </section>

    • 2

相关问题

  • 如何用线条绘制立体图并进行动画处理?

  • 如何将心形图像添加到按钮?

  • 如何布置菜单

  • 如何将转换应用于按钮内的文本?

  • 如何在网格中制作滚动项目?

  • 图片与文本重叠的矩形

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5