網站首頁 學習教育 IT科技 金融知識 旅遊規劃 生活小知識 家鄉美食 養生小知識 健身運動 美容百科 遊戲知識 綜合知識
當前位置:趣知科普吧 > 綜合知識 > 

css三角形怎麼寫

欄目: 綜合知識 / 發佈於: / 人氣:7.56K
1.如何用CSS寫一個三角形

1.可以用css3的border-radius屬性來實現,支援ie9+

css三角形怎麼寫

<div class="dm">

</div>

<div class="dm1">

</div>

<div class="dm2">

</div>

<div class="dm3">

</div>

<div class="dm4">

</div>

<div class="dm5">

</div>

<div class="dm6">

</div>

<div class="dm7">

</div>

<style>

.dm {

width: 0;

height: 0;

border-left: 50px solid transparent;

border-right: 50px solid transparent;

border-bottom: 100px solid #00897B;

}

.dm1{

width: 0;

height: 0;

border-left: 50px solid transparent;

border-right: 50px solid transparent;

border-top: 100px solid #00897B;margin-top: 20px;

}

.dm2{

width: 0;

height: 0;

border-top: 50px solid transparent;

border-right: 100px solid #00897B;

border-bottom: 50px solid transparent;margin-top: 20px;

}

.dm3{

width: 0;

height: 0;

border-top: 50px solid transparent;

border-left: 100px solid #00897B;

border-bottom: 50px solid transparent;margin-top: 20px;

}

.dm4{

width: 0;

height: 0;

border-top: 100px solid #00897B;

border-right: 100px solid transparent;margin-top: 20px;

}

.dm5{

width: 0;

height: 0;

border-top: 100px solid #00897B;

border-left: 100px solid transparent; margin-top: 20px;

}

.dm6{

width: 0;

height: 0;

border-bottom: 100px solid #00897B;

border-right: 100px solid transparent

}

.dm7{

width: 0;

height: 0;

border-bottom: 100px solid #00897B;

border-left: 100px solid transparent;

}

</style>

2.利用CSS怎樣寫出三角形

#bottom{ width:0px; height:0px; border-left:30px solid #FFFFFF; border-top:30px #FF6699 solid; border-right:30px solid #FFFFFF; } #top{ width:0px; height:0px; border-left:30px solid #FFFFFF; border-bottom:30px #FF6699 solid; border-right:30px solid #FFFFFF; } #rt{ width:0px; height:0px; border-left:30px solid #FFffff; border-bottom:30px #ff6699 solid; } #lt{ width:0px; height:0px; border-right:30px #FFffff solid; border-bottom:30px solid #FF0000; } 下 上 右下 左下。

3.如何用CSS寫一個三角形

1.可以用css3的border-radius屬性來實現,支援ie9+ <style> .dm { width: 0; height: 0; border-left: 50px solid transparent; border-right: 50px solid transparent; border-bottom: 100px solid #00897B;}.dm1{ width: 0; height: 0; border-left: 50px solid transparent; border-right: 50px solid transparent; border-top: 100px solid #00897B;margin-top: 20px;}.dm2{ width: 0; height: 0; border-top: 50px solid transparent; border-right: 100px solid #00897B; border-bottom: 50px solid transparent;margin-top: 20px;}.dm3{ width: 0; height: 0; border-top: 50px solid transparent; border-left: 100px solid #00897B; border-bottom: 50px solid transparent;margin-top: 20px;}.dm4{ width: 0; height: 0; border-top: 100px solid #00897B; border-right: 100px solid transparent;margin-top: 20px;}.dm5{ width: 0; height: 0; border-top: 100px solid #00897B; border-left: 100px solid transparent; margin-top: 20px;}.dm6{ width: 0; height: 0; border-bottom: 100px solid #00897B; border-right: 100px solid transparent}.dm7{ width: 0; height: 0; border-bottom: 100px solid #00897B; border-left: 100px solid transparent;}</style>。

4.怎樣用html或css製作三角形

希望可以幫到樓主,下面是實現的代碼:

#triangle-up {

width: 0;

height: 0;

border-left: 50px solid transparent;

border-right: 50px solid transparent;

border-bottom: 100px solid red;

}

HTML代碼:

<div id="trlangle-up></div>

希望我的回答對樓主有幫助,不懂可以繼續追問。

5.如何使用HTML&CSS寫一個三角形

<div style="width:200px; text-align:center; color:#fff; background-color:red;">;等邊三角形</div>

<div style="width:200px; text-align:center; color:#fff; background-color:red;">;等腰直角三角形</div>

6.利用CSS怎樣寫出三角形利用CSS+DIV怎樣寫

<meta charset="utf-8">無標題<a href="https://qzkpb.com/tags-200p-0.html" title="檢視更多文檔的文章" target="_blank" >文檔</a><style>.a{ border-bottom:1px solid #aaa; height:50px; width:100px; position:relative; overflow:hidden;}.b{ position:absolute; display:block; top:0px; left:0px; width:100px; height:50px;}.b i,.b em{ position:absolute; left:0px; bottom:0px; border-color:transparent; border-color:rgba(255,255,255,0); border-style:solid; border-width:0 50px 50px 50px;}.b i{ border-bottom-color:#aaa;}.b em{ border-bottom-color:#FFF; bottom:-1px;}.text{ position:absolute; bottom:10px; background:none; border:none; outline:none; text-align:center; width:100%;}</style><body>

7.css3怎樣做一個這樣的三角形,寫一下

用線性濾鏡就行 background: linear-gradient(135deg,rgba(0,0,0,0) 34px,red 36px); background: -o-linear-gradient(135deg,rgba(0,0,0,0) 34px,red 36px); background: -moz-linear-gradient(135deg,rgba(0,0,0,0) 34px,red 36px); background: -webkit-linear-gradient(135deg,rgba(0,0,0,0) 34px,red。

8.怎麼利用CSS3繪製三角形

1、新建一個html5網頁,名稱爲index.html,在<body>;代碼中寫上四個div,分別是向上、向下、向左,向右四個三角形,代碼如下:

<div class="triangle-up"> <;!--向上的三角--> </div>

<div class="triangle-down"> <;!--向下的三角--> </div>

<div class="triangle-left"> <;!--向左的三角--> </div>

<div class="triangle-right"> <;!--向右的三角--> </div>

2、然後新建一個css檔案style.css,並在index.html中引入,引入代碼:<link rel="stylesheet" type="text/css" href="style.css">

3、先做向上的三角形,這裏有兩種寫法,大家可以參考下。在css檔案中輸入以下代碼:

第一種: .triangle-up {

width:0;

height:0;

border-left:30px solid transparent;

border-right:30px solid transparent;

border-bottom:30px solid #fff;

}

第二種:.triangle-up {

width:0;

height:0;

border:30px solid transparent;

border-bottom-color:#fff;

}

4、接下來寫向下的三角形,繼續在css檔案中輸入以下代碼:

.triangle-down {

width:0;

height:0;

border-left:20px solid transparent;

border-right:20px solid transparent;

border-top:20px solid #0066cc;

}

5、然後是向左的三角形,代碼爲:

.triangle-left {

width:0;

height:0;

border-top:30px solid transparent;

border-bottom:30px solid transparent;

border-right:30px solid yellow;

}

6、最後是向右的三角形,代碼爲:

.triangle-right {

width:0;

height:0;

border-top:50px solid transparent;

border-bottom: 50px solid transparent;

border-left: 50px solid green;

}

Tags:css