双飞翼布局,中间列文字不换行,是什么原理呢?
来源:3-8 布局-解题-4

躲躲藏藏
2020-11-28
老师这个是什么原理呢, 为什么 wrap 的文字只显示一行呢。
<style>
.center{
width: 100%;
background: red;
}
.wrap{
margin: 0 200px;
}
.left{
width: 200px;
background: brown;
margin-left: -100%;
}
.right{
width: 200px;
background: burlywood;
margin-left: -200px;
}
.column{float: left;}
.box{overflow: hidden;}
</style>
<div class="box">
<div class="center column">
<div class="wrap">121212112121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121212211212121221121212121221121212121221121212121221121212121221121212121221121212121221121212121221121212121221121212121221121212121212211212121212211212121212211212121212211212121212211212121212211222112121212122112121212122112121212122112121212122112</div>
</div>
<div class="left column">this is left</div>
<div class="right column">this is right</div>
</div>
写回答
1回答
-
正常写汉字、或者正常的英文(单词之间有空格的),就可以正常换行了。
如果是连续的英文或者数字,浏览器会以为这是一个很长的单词,默认是不会换行的。
012020-12-01
相似问题