html字段两边顶格换行,html-在div的两边换行

看起来您想要的是float:center吗?好吧,问题在于此属性不存在.

这里有两种选择:

像这样设置标记:

Awesome content

left text here

right text here

使用CSS

#wrap {

width:250px;

height: 250px;

background: yellow;

position: absolute;

top: 0;

left: 50%;

margin-left: -125px;

}

#l {

float: left;

}

#r {

float: right;

}

#l, #r {

width: 49%;

}

#l:before, #r:before {

content:"";

width: 125px;

height: 250px;

}

#l:before {

float: right;

}

#r:before {

float: left;

}

标记

Awesome content which floats in the center
all the text here

的CSS

.container {

font-size: small;

background: aqua;

position: relative;

}

.exclusion {

background-color: lime;

-ms-wrap-flow: both;

-ms-wrap-margin: 10px;

z-index: 1;

position:absolute;

left:0;right:0;

top:0;bottom:0;

width: 150px;

height: 100px;

background: yellow;

margin: auto;

}

有关CSS排除浏览器支持和更多资源的更多信息,请参见我的答案here.

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值