1. 元素的垂直水平居中
- <style>
- .father{
- position: relative;
- }
- .sun{
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- }
- </style>
- <div class="father">
- <div class="sun"></div>
- </div>
2. 强制禁止换行
white-space:nowrap;
3. 超出出现滚动条
- <style>
- .slide{
- overflow: auto;
- width: 100%;
- }
- </style>
- <div class="slide">
- </div>
来源: http://www.bubuko.com/infodetail-2586596.html