css3子级高度与父级同高,内容垂直居中

 1 .E-wrap{
 2             overflow: hidden;
 3             position: relative;
 4             border: 1px solid #ccc;
 5             margin: 30px auto 0;
 6             width: 500px;
 7         }
 8         .E-left{
 9             position: absolute;
10             left: 0;
11             bottom: 0;
12             top: 0;
13             right: 80%;
14             border-right: 1px solid #ccc;
15             
16         }
17         .E-left li{
18             display: table;
19             width: 100%;
20             height:100%;
21         }
22         .E-left li p{
23             display: table-cell;
24             vertical-align: middle;
25             text-align: center;
26         }
27         .E-rihgt{
28             float: right;
29             width: 80%;
30         }
31         .E-rihgt li{
32             height: 40px;
33             line-height: 40px;
34             text-align: center;
35             border-bottom: 1px solid #ccc;
36         }
37         .E-rihgt li:last-child{
38             border-bottom:none;
39         }
<section class='E-wrap'>
    <ul class='E-left'>
        <li>
            <p>左侧文字</p>
        </li>
    </ul>
    <ul class='E-rihgt'>
        <li>1</li>
        <li>1</li>
        <li>1</li>
        <li>1</li>
        <li>1</li>
    </ul>


</section>

 效果图


更多专业前端知识,请上 【猿2048】www.mk2048.com
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值