css横向 弹性盒子布局的一些属性
2017-01-20 14:47
597 查看
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>Hello APP</title>
<link rel="stylesheet" type="text/css" href="./css/bootstrap-3.3.5/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="./css/api.css" />
<style type="text/css">
html,body{
}
header{
position: relative;
}
header .center{
position: relative;
width: 100px;
height: 50px;
background: url(../image/***.png);
background-size: 74px 19px;
background-repeat: no-repeat;
background-position:center center;
}
/* 横向 弹性盒子布局 */
nav{
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-orient:horizontal;
-webkit-flex-flow:row;
flex-flow:row;
position: relative;
width: 100%;
height: 40px;
background-color: #e1017e;
}
nav .menu{
-webkit-box-flex:1;
-webkit-flex: 1;
flex: 1;
width:100%;
height: 40px;
line-height: 40px;
font-size:13px;color:#fff; text-align: center;
}
</style>
</head>
<body>
<header>
<div class="left"></div>
<div class="center"></div>
<div class="right"></div>
</header>
<nav>
<div class="menu">水果</div>
<div class="menu">零食</div>
<div class="menu">食材</div>
<div class="menu">牛奶</div>
<div class="menu">蔬菜</div>
</nav>
<div></div>
</body>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width"/>
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<title>Hello APP</title>
<link rel="stylesheet" type="text/css" href="./css/bootstrap-3.3.5/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="./css/api.css" />
<style type="text/css">
html,body{
}
header{
position: relative;
}
header .center{
position: relative;
width: 100px;
height: 50px;
background: url(../image/***.png);
background-size: 74px 19px;
background-repeat: no-repeat;
background-position:center center;
}
/* 横向 弹性盒子布局 */
nav{
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-orient:horizontal;
-webkit-flex-flow:row;
flex-flow:row;
position: relative;
width: 100%;
height: 40px;
background-color: #e1017e;
}
nav .menu{
-webkit-box-flex:1;
-webkit-flex: 1;
flex: 1;
width:100%;
height: 40px;
line-height: 40px;
font-size:13px;color:#fff; text-align: center;
}
</style>
</head>
<body>
<header>
<div class="left"></div>
<div class="center"></div>
<div class="right"></div>
</header>
<nav>
<div class="menu">水果</div>
<div class="menu">零食</div>
<div class="menu">食材</div>
<div class="menu">牛奶</div>
<div class="menu">蔬菜</div>
</nav>
<div></div>
</body>
相关文章推荐
- js+css3实现旋转效果
- ProgressDialog样式
- CSS布局 — 圣杯布局 与 双飞翼布局
- CSS布局——display:table-cell; 与display:table;
- 在css中使用自定义字体
- CSS3 table — 自适应布局表格
- 兼容IE7+的rgba()的方法
- 判断窗口高度
- CSS: display:none和visibility:hidden的区别
- 关于CSS常见兼容性问题
- 浮动布局:Flexbox
- CSS3 Background
- CSS外部引用方式
- Shape 样式
- CSS3 @font-face
- CSS3 Box-sizing
- CSS3 Text-overflow
- css设置图片高随宽变化而变化
- CSS学习资料
- CSS3 Animation