Wistain 2022-03-10 16:45 采纳率: 78%
浏览 284
已结题

怎么把按钮放在文本框后面?

问题遇到的现象和发生背景

img

问题相关代码,请勿粘贴截图
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>携程旅行</title>
    <link rel="stylesheet" type="text/css" href="demo.css"/>
</head>
<body>
    <div class="searchBox">
            <div class="searchLeftBox">
                <img src="1.png" width="140" height="100" alt="携程网">
                <div class="searchInputBox">
                    <span>
                    <input type="text" name="keywords" placeholder="搜索旅行地/酒店/旅游景点门票/交通" class="keywordsBox">
                    </span>
                    <span>
                    <input type="button" value="" class="searchButton">
                    <span>
                </div>
            </div>
        <div class="searchRightBox">
            <p class="topInfo"> 境内:95010</p>
            <p class="topInfo">(或)400-830-6666</p>
    </div>
</body>
</html>

```css
a:hover{
    color: #3983E5;
}

.searchBox{
    
}

.searchBox .searchLeftBox{
    float: left;
    display: flex;
    line-height: 80px;
    color: #666;
}
.searchBox .searchLeftBox img{
    width: 150px;
    height: 50px;
    margin-top: 18px;
    margin-left: 80px;
}
.searchBox .searchInputBox{
    margin-left: 60px;
    width: 373px;
}
.searchInputBox .keywordsBox{
    padding: 4px;
    background: #fff;
    border: 1px solid #8EBEFC;
    width: 327px;
    border-radius: 3px 0 0 3px;
    height: 20px;
}
.searchInputBox .searchButton{
    float: left;
    width: 43px;
    height: 30px;
    background: url(3.png) no-repeat center;
    background-size: 43px;
    border-radius: 0 3px 3px 0;
    border: none;
    position: relative;
}
.searchInputBox .searchButton:hover{
    background: url(2.png) no-repeat center;
    background-size: 43px;
    cursor: pointer;
}

.searchBox  .searchRightBox{
    float: right;
}
.searchRightBox .topInfo{
    font-family: "microsoft yahei"
    margin:0;
    padding: 0;
    color: #666;
    font-size: 12px;
    margin-top: 24px;
    line-height: 0px;
    text-align: right;
}

运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果
  • 写回答

5条回答 默认 最新

  • 沐卿゚ 2022-03-10 16:58
    关注

    你好,这个按钮吗

    img

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

报告相同问题?

问题事件

  • 系统已结题 3月18日
  • 已采纳回答 3月10日
  • 创建了问题 3月10日

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效