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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何實現讓 “div1” 移動時 ,下面的 “div” 也跟著下移?

如何實現讓 “div1” 移動時 ,下面的 “div” 也跟著下移?

精慕HU 2022-07-07 16:07:16
如何實現讓 “div2” 與 “move” 同時移動時,“div2” 始終保持在 “move” 上面<!DOCTYPE html><head><meta charset="utf-8"><title></title><style rel="stylesheet" type="text/css">#div1{background-color: #000000;width: auto;height: 200px;transition: all 2s;}#div1:hover{transform:translate(0,100px);}#div2{background-color: red;width: 200px;height: 200px;transition:all 3s;}#div2:hover{transform: translate(650%,0);}#move:hover{transform: translate(90%,0);}#move{width: 500px;height: 200px;transition: all 3s;background-color: #333333;float: left;}#div3{width: auto;height: 200px;background-color: green;transition:all 3s;clear: both;}#div5:hover{transform: translate(0,100px);background-color: yellow;}</style></head><body><div id="div1"></div><div id="move"></div><div id="div2"></div><div id="div3"></div></body></html>
查看完整描述

1 回答

?
拉風的咖菲貓

TA貢獻1995條經驗 獲得超2個贊

這是你希望的效果嗎:


<style rel="stylesheet" type="text/css">        #div1 {            background-color: #000000;            width: auto;            height: 200px;            transition: all 2s;        }        #div1:hover {            margin-top: 100px;        }        #div2 {            background-color: red;            width: 200px;            height: 200px;            transition: all 3s;            float: left;            margin-left: -500px;        }        #div2:hover {            transform: translate(650%, 0);        }        #move:hover {            transform: translate(90%, 0);        }        #move {            width: 500px;            height: 200px;            transition: all 3s;            background-color: #333333;            float: left;        }        #div3 {            width: auto;            height: 200px;            background-color: green;            transition: all 3s;            clear: both;        }        #div5:hover {            transform: translate(0, 100px);            background-color: yellow;        }    </style>


查看完整回答
反對 回復 2022-07-11
  • 1 回答
  • 0 關注
  • 165 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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