弹性盒子布局flex, box-sizing: border-box

发布时间:2020-06-22 23:12:54 作者:pmlinjian
来源:网络 阅读:1178

<!DOCTYPE html>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>弹性盒子布局flex, box-sizing: border-box</title>

<meta name="keywords" content="积分商城、兑换,春游兑换季,免费"/>

<meta name="description" content="积分春游兑换季,更多车主出行超值商品免费兑换"/>

<meta http-equiv="content-language" content="zh-cn" />

<meta http-equiv="x-ua-compatible" content="ie=emulateie7" />

<meta name="copyright" content="本页版权归iicoo所有。All Rights Reserved" />

<meta name="author" content="iicoo" />

<meta content="yes" name="apple-mobile-web-app-capable" />

<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />

<meta content="black-translucent" name="apple-mobile-web-app-status-bar-style" />

<meta content="telephone=no" name="format-detection" />


<style type="text/css">

*{margin: 0; padding: 0;}

input{color:inherit;font:inherit;  -webkit-box-flex: 1;box-flex: 1;-webkit-appearance: none;-webkit-tap-highlight-color: rgba(255,0,0,0); box-sizing: border-box; display: block;}

html {

  height: 100%;

.main{padding: 10px;}

.box {

  display: -webkit-box;

  display: box;

  display: flex;

  display: -webkit-flex;

  background-color: #dbdbdb;

  height: 36px;

  padding: 10px 2px;

}  

.l{width: 110px; height: 36px;}

.l input,.r input{width: 100%;line-height: 36px;border: 1px solid #ccc;box-sizing: border-box;}

.r{-webkit-box-flex: 1;-ms-flex:1; flex:1;padding-left: 5px;}

.r2 input{line-height: 36px;}

.r2{width: 100%}

</style>

<script type="text/javascript">

 //

</script>

</head>

<body>

    <div class="main">

        <div class="box">

            <div class="l"><input type="text" placeholder="请输入关键字1" /></div>

            <div class="r"><input type="text" placeholder="请输入关键字2" /></div>

        </div>

        <div class="box"><div class="r2"><input type="text" placeholder="请输入关键字2" /></div></div>

    </div> 

</body>

</html>


推荐阅读:
  1. Java实现的模糊匹配某文件夹下的文件并删除功能示例
  2. HTTPS通信的C++实现

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

弹性盒子布局flex box-sizing: border- lex

上一篇:ELKstack-logstash 使用技巧小计

下一篇:进击的python【第四集】

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》