HTML:

<div class="my_nav">
<ul>
<li class="tiao cur" id="order_tab_1"><a href="#">待付款</a></li>
<li class="tiao " id="order_tab_2"><a href="#">待收货/提货</a></li>
<li class="tiao " id="order_tab_3"><a href="#">全部订单</a></li>
</ul>
</div>

Css:

        .my_nav {
width: 100%;
border: 1px solid #e0e0e0;
border-width: 1px 0;
background-color: #fff;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.my_nav ul {
display: box;
display: -ms-box;
display: -webkit-box;
display: flex;
display: -ms-flexbox;
display: -webkit-flex;
overflow: hidden;
}
.my_nav li.cur {
background-color: #E5E5E5;
}
.my_nav li:first-child {
border-left: 0;
}
.my_nav li {
display: block;
flex: 1;
-ms-flex: 1;
-webkit-flex: 1;
box-flex: 1;
-ms-box-flex: 1;
-webkit-box-flex: 1;
width: 100px;
text-align: center;
font-size: 12px;
line-height: 36px;
border-left: 1px solid #e0e0e0;
padding: 0px;
background-color: #f3f3f3;
}
.my_nav a {
display: block;
min-height: 36px;
}
a {
border-bottom-color: #cccccc;
border-bottom-style: none;
COLOR: #888888;
text-decoration: none;
font-family: "Microsoft Yahei",Arial, Helvetica, sans-serif;
outline: none;
}

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui" name="viewport">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta content="telphone=no" name="format-detection">
<title>等分居中</title>
<link media="all" href="http://www.w3cplus.com/mcommon/reset.css" rel="stylesheet">
<style type="text/css">
.demo{
line-height:44px;
margin-bottom: 20px;
text-align: center;
background-color: #0078e7;
color: #fff;
} .flex-equal,.flex-center, .justify {
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
} .flex-equal li {
-webkit-box-flex: ;
-ms-flex: ;
-webkit-flex: ;
flex: ;
} .table-equal {
display: table;
table-layout: fixed;
width: %;
}
.table-equal li {
display: table-cell;
}
.demo-center{
border: 1px solid #ccc;
margin:20px;
height:200px;
}
.demo-center .children{
background: #0078e7;
color: #fff;
width:150px;
line-height:;
text-align:center;
}
.flex-center {
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
} .translate-center{
position: relative;
} .translate-center .children{
position: absolute;
top: %;
left: %;
-webkit-transform: translate(-%, -%);
transform: translate(-%, -%);
}
.justify {
-webkit-box-pack: justify;
-ms-flex-pack: justify;
-webkit-justify-content: space-between;
justify-content: space-between;
padding: 10px;
background: #0078e7;
color:#fff;
line-height: 32px;
}
</style>
</head>
<body>
<h2>flex等分</h2>
<ul class="flex-equal demo">
<li>手机</li>
<li>联系人</li>
<li>信息</li>
<li>主屏</li>
</ul> <ul class="flex-equal demo">
<li>手机</li>
<li>联系人</li>
<li>信息</li>
</ul>
<h2>table等分</h2>
<ul class="table-equal demo">
<li>手机</li>
<li>联系人</li>
<li>信息</li>
<li>主屏</li>
</ul>
<ul class="table-equal demo">
<li>手机</li>
<li>联系人</li>
<li>信息</li>
</ul>
<h2>flex居中</h2>
<div class="flex-center demo-center">
<div class="children">子元素水平垂直居中</div>
</div>
<h2>translate居中</h2>
<div class="translate-center demo-center">
<div class="children">子元素水平垂直居中</div>
</div>
<h2>两端对齐</h2>
<div class="justify"><h2>左边对齐</h2><span>右边对齐</span></div>
</body>
</html>

原文地址:http://www.cnblogs.com/xinlinux/p/4463608.html

LI 导航的更多相关文章

  1. 不可思议的纯CSS导航栏下划线跟随效果

    先上张图,如何使用纯 CSS 制作如下效果? 在继续阅读下文之前,你可以先缓一缓.尝试思考一下上面的效果或者动手尝试一下,不借助 JS ,能否巧妙的实现上述效果. OK,继续.这个效果是我在业务开发的 ...

  2. 如何使用纯CSS制作特效导航条?

    先上张图,如何使用纯 CSS 制作如下效果? 在继续阅读下文之前,你可以先缓一缓.尝试思考一下上面的效果或者动手尝试一下,不借助 JS ,能否巧妙的实现上述效果. OK,继续.这个效果是我在业务开发的 ...

  3. Bootstrap4 导航栏

    Bootstrap4 导航栏 目录 Bootstrap4 导航栏 动态选项卡 标准的导航栏 导航对齐方式 导航栏的组成 ul 元素中包含navbar-nav 类 表示导航栏中ul li元素中包含nav ...

  4. [HTML/CSS]导航栏的下划线跟随效果

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  5. navLI鼠标滑上显示下拉导航

    <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>l ...

  6. Bootstrap(7) 输入框和导航组件

            一.输入框组件 文本输入框就是可以在<input>元素前后加上文字或按钮,可以实现对表单控件的扩展. //在左侧添加文字 <!-- //在左侧添加文字 --> ...

  7. 纯css导航栏下划线

    .nav-underline > *{/* 指定容器,里面可以是li.span等多样化的元素 */ display: inline-block; margin: -3px; padding: 1 ...

  8. 奇妙的CSS3—导航栏下划线跟随效果

    先来看一下效果: 1.基本效果就是这样的 ,鼠标悬停,下划线划入.鼠标离开,下划线划出 2.下划线的划入是有方向的,从左侧划入悬停,下划线由左向右伸长.从右侧划入,下划线由又往左伸长 实现思路 1.导 ...

  9. 纯css导航下划线跟随效果【转载】

    css: ul { display: flex; position: absolute; width: 800px; top: 50%; left: 50%; transform: translate ...

随机推荐

  1. Inheritance - SGU 129(线段与多边形相交的长度)

    题目大意:给一个凸多边形(点不是按顺序给的),然后计算给出的线段在这个凸多边形里面的长度,如果在边界不计算. 分析:WA2..WA3...WA4..WA11...WA的无话可说,总之细节一定考虑清楚, ...

  2. hdoj 1285 确定比赛名次【拓扑排序】

    确定比赛名次 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Subm ...

  3. Tomcat8 配置NIO

    conf/server.xml 打开:<Executor name="tomcatThreadPool" namePrefix="catalina-exec-&qu ...

  4. matlab初学者_脚本文件调用函数文件

    问题: matlab里面有两种文件,一种是脚本文件,一种是函数文件,为了模块化程序,我们需要把专门的功能写成一个函数封装到某个函数文件里面. 那么来看如何在脚本文件里调用函数文件中的函数. 注意点: ...

  5. uva11549 Floyd判圈法

    题意: 给两个数n, k,每次将k平方取k的前n位,问所有出现过的数的最大值 原来这就是floyd判圈法.. #include<cstdio> #include<cstdlib> ...

  6. PHP+IIS7+PHPMangerForIIS搭建开发环境

    准备工作 1.安装IIS 2.安装php 3.安装phpmanager 准备工作做好后,开始搭建环境 1.在Internet信息服务管理器下找到PHPManager 2.点击Register new ...

  7. Annotation Type @bean,@Import,@configuration使用--官方文档

    @Target(value={METHOD,ANNOTATION_TYPE}) @Retention(value=RUNTIME) @Documented public @interface Bean ...

  8. 1 - SQL Server 2008 之 使用SQL语句创建具有约束条件的表

    约束条件分为以下几种: 1)非空约束,使用NOT NULL关键字: 2)默认值约束,使用DEFAULT关键字: 3)检查约束,使用CHECK关键字: 4)唯一约束,使用UNIQUE关键字: 5)主键约 ...

  9. oracle 异常管理

    命名的系统异常                  产生原因 access_into_null 未定义对象 CASE_NOT_FOUND CASE 中若未包含相应的 WHEN ,并且没有设置 ELSE ...

  10. 10.8 noip模拟试题

      1.花 (flower.cpp/c/pas) [问题描述] 商店里出售n种不同品种的花.为了装饰桌面,你打算买m支花回家.你觉得放两支一样的花很难看,因此每种品种的花最多买1支.求总共有几种不同的 ...