css向左浮动错乱,CSS溢出向左浮动

CSS技巧.将名称放在下一行或同一行上

如果第一行很短,则名称将放在下一行.如果第一行很长,则名称放在同一行.

/* heart of the matter */

.container:first-line {

word-spacing: 240px; /* the width of the container,or more */

}

.content {

word-spacing: normal;

}

.insert {

margin-right: -11px; /* defined by the normal inter-word space */

}

/* nice look */

.container {

border: 5px solid black;

float: left;

font-family: Helvetica;

font-size: 20px;

font-weight: bold;

margin: 0 15px 30px 0;

min-height: 60px;

padding: 8px 10px;

width: 240px;

}

.name {

color: red;

}

/* little explanation */

.colored-background .content { background-color: lightblue; }

.colored-background .insert { background-color: orange; }

Something

Steve

Something Something Else

Steve

Something

Steve

Something Something Else

Steve

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值