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

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

用div畫圣誕樹 兩個三角形怎么合在一起?

用div畫圣誕樹 兩個三角形怎么合在一起?

妙蛙不開花 2017-11-02 18:34:34
要的效果如下!!請各位幫忙!
查看完整描述

2 回答

?
什么名字都被占用

TA貢獻17條經驗 獲得超3個贊

<!DOCTYPE html>

<html>

?<head>?

? <meta charset="UTF-8" />?

? <title>Document</title>?

? <style>

? ? ? /*子元素偏移是相對于父層.wrap來定位*/

? ? ? #trip1{ width: 0px; height: 0px; border-top: 50px solid rgba(200,200,200,0); border-right: 50px solid rgba(200,200,200,0); border-bottom: 50px solid green; border-left: 50px solid rgba(200,200,200,0);position: absolute;top: 0;left: 50%;margin-left: -50px; }?

? ? ? #trip2{ width: 0px; height: 0px; border-top: 100px solid rgba(200,200,200,0); border-right: 100px solid rgba(200,200,200,0); border-bottom: 100px solid green; border-left: 100px solid rgba(200,200,200,0); position: absolute;top:0px;left: 50%;margin-left: -100px;}

? ? /*設置父元素相對定位*/

? ?.wrap{width: 500px;height:300px;margin: 20px auto;position: relative;}?

? </style>?

?</head>?

?<body>?

? <div class="wrap">?

? ?<div id="trip1"></div>?

? ?<div id="trip2"></div>?

? </div>??

?</body>

</html>


查看完整回答
反對 回復 2017-11-10
?
什么名字都被占用

TA貢獻17條經驗 獲得超3個贊

用絕對定位做

查看完整回答
反對 回復 2017-11-02
  • 妙蛙不開花
    妙蛙不開花
    有代碼嗎
  • 什么名字都被占用
    什么名字都被占用
    方便的話,你把代碼復制給我,我來改一下哦
  • 妙蛙不開花
    妙蛙不開花
    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style> #trip1{ width: 0px; height: 0px; border-top: 100px solid rgba(200,200,200,0); border-right: 100px solid rgba(200,200,200,0); border-bottom: 100px solid green; border-left: 100px solid rgba(200,200,200,0); } #trip2{ width: 0px; height: 0px; border-top: 100px solid rgba(200,200,200,0); border-right: 100px solid rgba(200,200,200,0); border-bottom: 100px solid green; border-left: 100px solid rgba(200,200,200,0); } </style> </head> <body> <div> <div id="trip1"></div> <div id="trip2"></div> </div> </body> </html>
點擊展開后面1
  • 2 回答
  • 0 關注
  • 1683 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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