• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

Yancy00

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

css-输入框和按钮水平对齐

image

<style>
	.container {
		margin: 0 auto;
		margin-top: 160px;
		width: 600px;
	}

	.search {
		width: 100%;
		margin-top: 20px;
		height: 40px;
	}

	.search input {
		width: 85%;
		height: 100%;
		font-size: 18px;
		padding-left: 10px;
		float: left; //都左浮动.间隙就没了
		box-sizing: border-box;   //这里
	}
	.search button {
		width: 15%;
		height: 100%;
		float: left;   //都左浮动
		border: none;
		vertical-align: bottom;  //这里
		background-color: steelblue;
	}
</style>

<div  class="container">
    <div class="search">
        <input type="text" v-model="city">
        <button>查询</button>
        <div class="clear"></div>
    </div>
</div>

posted on 2023-03-25 13:08  Yancy00  阅读(153)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3