html表格怎么垂直跨度,html – 内联块div内的垂直对齐跨度文本

我正在建立一个平面设计的网站.我有一个标题,下面有两个不同颜色的块,彼此相邻.我尝试左右浮动,但建议使用display:inline-block代替.

不过,我遇到了一个问题.我想在左侧和右侧块的中间放置一些文本,并尝试使用align-items:center,但想通了只有在div设置为flex时才有效.

所以我的问题是,我可以以某种方式保持我的内联块并让我的文本居中在块的中间(水平和垂直)?

body {

margin: 80px 0 0;

}

#pagewrapper {

width: 100%;

}

#header {

width: 100%;

height: 80px;

background-color: #008B8B;

position: fixed;

top: 0;

}

.content-left,.content-right {

width: 50%;

height: 500px;

color: #FFFFFF;

display: -moz-inline-stack;

display: inline-block;

zoom: 1;

*display: inline;

}

.content-left {

background-color: #66CC99;

}

.content-right {

background-color: #20B2AA;

}

#header-bot {

height: 800px;

background-color: #F8F8FF;

}

#footer {

height: 50px;

background-color: #AFEEEE;

}

.title {

font-size: 18px;

}

This is left Content

This is Right Content

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值