核心提示:css实现水平(横向)滚动条效果!DOCTYPE htmlhtml lang=enheadmeta charset=UTF-8titleDocument/titlestyle.p1 {width: 2...
css实现水平(横向)滚动条效果
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.p1 {
width: 200px;
height: 100px;
overflow-x: scroll;
/* 内容会被裁剪,会以滚动条显示 */
overflow-y: hidden; /* 超出内容不可见 */
white-space: nowrap; /* 不换行 */
/* 文本不会换行,会在同一行上继续,直到遇到<br>为止 */
}
</style>
</head>
<body>
<p class="p1">
<img src="images/p_small_001.jpg" alt="">
<img src="images/p_small_002.jpg" alt="">
<img src="images/p_small_003.jpg" alt="">
<img src="images/p_small_004.jpg" alt="">
<img src="images/p_small_005.jpg" alt="">
<img src="images/p_small_006.jpg" alt="">
<img src="images/p_small_007.jpg" alt="">
</p>
</body>
</html>


