草又莓了796 2023-04-01 22:18
浏览 12
已结题

关于#less#的问题:rem移动端布局,为什么中间的搜索框会被右边的盒子覆盖掉啊

rem移动端布局,为什么中间的搜索框会被右边的盒子覆盖掉啊😭。

img

img

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,user-scalable=no,maximum-scale=1.0,minimum-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/index.css">
</head>

<body>
    <div class="search-content">
        <a href="#" class="classify"></a>
        <div class="search">
            <form action="">
                <input type="text" value="厨卫保暖季,哒哒哒" />
            </form>
        </div>
        <a href="#" class="login">登录</a>
    </div>
</body>

</html>

@import "common";

body {
    min-width: 320px;
    width: 15rem;
    margin: 0 auto;
    line-height: 1.5;
    font-family: Arial, Helvetica;
    background: #F2F2F2;
}

@baseFont: 50;

.search-content {
    display: flex;
    position: fixed;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 15rem;
    height: (88rem / @baseFont);
    margin: 0 auto;
    background-color: #FFC001;

    .classify {
        width: (44rem / @baseFont);
        height: (70rem / @baseFont);
        background-color: pink;
        margin: (11rem / @baseFont) (25rem / @baseFont) (7rem / @baseFont) (24rem / @baseFont);
        background: url(../images/classify.png) no-repeat;
        background-size: (44rem / @baseFont) (70rem / @baseFont);
    }

    .search {
        flex: 1;

        input {
            height: (66rem / @baseFont);
            width: 100%;
            border: 0;
            outline: none;
            margin-top: (12rem / @baseFont);
            padding-left: (55rem / @baseFont);
            border-radius: (33rem / @baseFont);
            font-size: (25rem / @baseFont);
            background-color: #FFF2CC;
            color: #999;
        }
    }

    .login {
        width: (75rem / @baseFont);
        height: (70rem / @baseFont);
        background-color: purple;
        padding: (10rem / @baseFont);
        font-size: (25rem / @baseFont);
        line-height: (70rem / @baseFont);
        text-align: center;
        color: #fff;
    }
}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 已结题 (查看结题原因) 4月2日
    • 修改了问题 4月1日
    • 创建了问题 4月1日

    悬赏问题

    • ¥15 mysql将查询的结果作为动态列名怎么实现
    • ¥50 python自动地图截图脚本
    • ¥15 悬赏一本书(内含Matlab代码)的书名、作者
    • ¥20 瑞萨RA4M1芯片刷写为arduino r4 minima
    • ¥15 前端vue跟后端java服务部署在线上阿里云服务器
    • ¥15 fastreport怎么判断当前页数
    • ¥15 Kylin-Desktop-V10-GFB-Release-JICAI_02- 2207-Build14-ARM64.iso有没有这个版本的系统啊
    • ¥15 能不能通过蓝牙将传感器数据传送到手机上
    • ¥20 100元python和数据科学实验项目
    • ¥15 根据时间在调用出列表