Satrol_ 2022-11-12 09:11 采纳率: 90.9%
浏览 22

如何如何做到加定位实现输入的内容不被过渡的小i覆盖

z-index要和定位连用但是当我加相对定位和绝对定位的时候某些效果又消失了求解?

img


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .input_Box {
            position: relative;
            width: 400px;
            margin: 100px auto 0;
            background-color: aqua;
        }
        .input_Box input {
            border: 0;
            width: 100px;
            height: 30px;
            outline: none;
            z-index: 9;
        }
        i {
            position: absolute;
            left: 0;
            bottom: 0;
            width: 100px;
            height: 1px;
            background-color: aqua;
            transition: 0.6s;
            
        }
        input:focus~i {
            position: absolute;
            height: 30px;
            z-index: 1;
        }
    </style>
</head>
<body>
    <div class="input_Box">
        <input type="text">
        <i></i>
    </div>
    
</body>
</html>
  • 写回答

1条回答 默认 最新

  • 经海路大白狗 前端领域优质创作者 2022-11-12 09:35
    关注

    img


    我看了半天没明白你要实现什么效果?
    私聊吧

    评论 编辑记录

报告相同问题?

问题事件

  • 创建了问题 11月12日

悬赏问题

  • ¥200 csgo2的viewmatrix值是否还有别的获取方式
  • ¥15 Stable Diffusion,用Ebsynth utility在视频选帧图重绘,第一步报错,蒙版和帧图没法生成,怎么处理啊
  • ¥15 请把下列每一行代码完整地读懂并注释出来
  • ¥15 pycharm运行main文件,显示没有conda环境
  • ¥15 寻找公式识别开发,自动识别整页文档、图像公式的软件
  • ¥15 为什么eclipse不能再下载了?
  • ¥15 编辑cmake lists 明明写了project项目名,但是还是报错怎么回事
  • ¥15 关于#计算机视觉#的问题:求一份高质量桥梁多病害数据集
  • ¥15 特定网页无法访问,已排除网页问题
  • ¥50 如何将脑的图像投影到颅骨上