0
点赞
收藏
分享

微信扫一扫

css小技巧

<div id="shizijia"></div>

#shizijia {
  margin-left:80px;
  background:blue;
  height:130px;
  position:relative;
  width:18px; 
}
#shizijia:after {
  background:green;
  content: "";
  height: 18px;
  left: -55px;
  position: absolute;
  top:50px;
  width: 130px;
}

①. 宽度不够时,字体会换行.

②. 强制不换行,文本不会换行,文本会在在同一行上继续,直到遇到br标签为止.

white-space: nowrap;

举报

相关推荐

0 条评论