小小web~ 2022-03-29 19:33 采纳率: 64%
浏览 72
已结题

span标签为什么会影响input?

span为什么会影响input呢?
input为什么上面会有距离呢?
字体图标怎么才能转化为提交属性或者其他的属性呢?

img

.body{
    width: 500px;
    height: 200px;
    background-color: yellowgreen;

    margin: auto;
    margin-top: 300px;
}
.body>div{
    width: 500px;
    height: 30px;
    background-color: aqua;
    line-height: 30px;
    
    
}
.body>div input{
    width: 200px;
    height: 30px;

    background-color: violet;
    outline: none;
    border: 1px solid red;
}
.body>div span{
    width: 30px;
    height: 30px;
    background-color: yellowgreen;
    font: 30px YouYuan;
    margin-left: 30px;
    
}



<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="../css/首页.css">
    <link rel="stylesheet" href="../icont/font_enck2kw2cef/iconfont.css">
</head>
<body>
    <div class="body">
        <div>
            <input type="search">
            <span class="iconfont icon-sousuo"></span>
        </div>
    </div>
</body>
</html>


  • 写回答

3条回答 默认 最新

  • 归来巨星 新星创作者: 前端开发技术领域 2022-03-30 09:46
    关注

    行内元素 和 行内块元素的区别 这个你可以了解一下

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 4月12日
  • 已采纳回答 4月4日
  • 创建了问题 3月29日