課程
/前端開發(fā)
/HTML/CSS
/初識(shí)HTML(5)+CSS(3)-升級(jí)版
老師幫忙看一下?
2019-07-09
源自:初識(shí)HTML(5)+CSS(3)-升級(jí)版 13-9
正在回答
不知道你像想實(shí)現(xiàn)什么效果,? 但應(yīng)該父元素設(shè)置為position: relative; 子元素設(shè)置為position: absolute;
針對你這個(gè),應(yīng)該吧outerNode設(shè)置為relative. controlsNode設(shè)置為absolute,這樣通過left right top buttom,就可以避免重合了.
上下兩個(gè)盒子 音樂信息與控制臺(tái) 定位有重合 是怎么回事呢
html:
<!DOCTYPE?html><html?lang="zh"><head><meta?charset="UTF-8"><meta?name="viewport"?content="width=device-width,?initial-scale=1.0"><meta?http-equiv="X-UA-Compatible"?content="ie=edge"><title>音頻播放器</title><link?rel="stylesheet"?type="text/css"?href="./css/base.css"></head><body><div?class="outerNode"><!--?音樂信息?--><div?class="informNode"><!--?封面圖?--><div?class="coverNode"></div><!--?音樂名稱?--><div?class="nameNode">Can't?Help?Falling?In?Love</div><!--?作者?--><div?class="authorNode">Elvis?Presley</div></div><!--?控制臺(tái)?--><div?class="controlsNode"><div?class="lineNode"></div></div></div></body></html>
css
*?{padding:?0;margin:?0;list-style:?none;}html,body?{width:?100%;height:?100%;background:?#0C0E14;font-family:?'Helvetica'}.outerNode?{width:?375px;height:?667px;background:?#151926;box-shadow:?0?8px?32px?rgba(0,?0,?0,?0.6);margin:?80px?auto;}/*?音樂信息?*/.informNode?{width:?375px;height:?406px;position:?relative;top:?64px;left:?0;}/*?封面圖?*/.coverNode?{width:?290px;height:?310px;background:?url(../images/Cover@2x.png)?no-repeat?center?center;background-size:?cover;margin:?0?auto;}/*?名稱?*/.nameNode?{width:?100%;height:?32px;font-size:?24px;text-align:?center;color:?#fff;font-family:?'PingFang?SC';line-height:?32px;font-weight:?200;margin-top:?40px;}/*?演唱者?*/.authorNode?{width:?100%;height:?24px;font-size:?14px;text-align:?center;color:?#656D85;line-height:?24px;}/*?控制臺(tái)?*/.controlsNode?{width:?375px;height:?auto;position:?relative;top:?48px;}/*?進(jìn)度條?*/.lineNode?{width:?343px;height:?12px;margin:?0?16px;}
舉報(bào)
HTML(5)+CSS(3)基礎(chǔ)教程8小時(shí)帶領(lǐng)大家步步深入學(xué)習(xí)標(biāo)簽用法和意義
1 回答各位幫忙看一下吧
6 回答老師,您好,幫忙解答一下。
1 回答麻煩幫忙看下
3 回答怎么老是提示我錯(cuò)誤,請幫忙一下看看
3 回答請各位幫忙看下
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2019-07-10
不知道你像想實(shí)現(xiàn)什么效果,? 但應(yīng)該父元素設(shè)置為position: relative; 子元素設(shè)置為position: absolute;
針對你這個(gè),應(yīng)該吧outerNode設(shè)置為relative. controlsNode設(shè)置為absolute,這樣通過left right top buttom,就可以避免重合了.
2019-07-09
上下兩個(gè)盒子 音樂信息與控制臺(tái) 定位有重合 是怎么回事呢
2019-07-09
html:
css