亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

老師 我想問一下 我的代碼為什么不能左右滑動呢

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />

<title>全屏切換--如果不指定寬度,是垂直的</title>

<style type="text/css">

*{padding:0;margin: 0;}

html,body{height: 100%;overflow: hidden;}

#container,.section{height:100%;}

.section{background-position: 50% 50%;background-size: cover;}

#section1{background-color:red;}

#section2{background-color: yellow;}

#section3{background-color: green;}

#section4{background-color: blue;}


.left{float:left;}

#container{width:400%;}

.section{width: 25%;}

</style>

</head>

<body>

<div id="container">

<div id="section1" class="section left"></div>

<div id="section2" class="section left"></div>

<div id="section3" class="section left"></div>

<div id="section4" class="section left"></div>

</div>

</body>

</html>


正在回答

2 回答

把overflow: hidden;這句話去掉,使用鼠標中間的滑輪滾動實現。

0 回復 有任何疑惑可以回復我~

不是拖動鼠標的滑動,而是使用鼠標中間的滑輪滾動實現,到這一步,還沒有寫使用鼠標拖動的方法呢。

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

老師 我想問一下 我的代碼為什么不能左右滑動呢

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號