css中li设了左浮动,如何使它宽度超过ul以后仍然不自动换行,成横排显示?
<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>Title</title><style>.b...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.box {
width: 530px;
height: 420px;
margin: 100px auto;
background-color: pink;
border: 1px solid #ccc;
}
.imgs {
width: 530px;
height: 420px;
overflow-x: auto;
}
.box ul li {
float: left;
}
</style>
</head>
<body>
<div class="box" id="screen">
<ul id="imgs">
<!-- 图片width=530px height=420px -->
<li><img src="images/1.png" alt=""></li>
<li><img src="images/4.png" alt=""></li>
<li><img src="images/3.pngim" alt=""></li>
</ul>
</div>
</body>
</html> 展开
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.box {
width: 530px;
height: 420px;
margin: 100px auto;
background-color: pink;
border: 1px solid #ccc;
}
.imgs {
width: 530px;
height: 420px;
overflow-x: auto;
}
.box ul li {
float: left;
}
</style>
</head>
<body>
<div class="box" id="screen">
<ul id="imgs">
<!-- 图片width=530px height=420px -->
<li><img src="images/1.png" alt=""></li>
<li><img src="images/4.png" alt=""></li>
<li><img src="images/3.pngim" alt=""></li>
</ul>
</div>
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询