
如何在內部 div 的頂部設計這個用黃色標記的三角形角?
uj5u.com熱心網友回復:
制作一個三角形,然后將其定位position: absolute。代碼中的更多解釋:
.box {
width: 200px;
height: 200px;
background-color: white;
border: 12px solid #aaa;
}
.triangle-left {
width: 0; /* this four code line for making a triangle */
height: 0;
border-top: 8px solid transparent;
border-right: 8px solid white;
border-bottom: 8px solid transparent;
position: absolute; /* this three code line for positioning of triangle */
top: 60px;
left: 10px;
}
<div class="box"></div>
<div class="triangle-left"></div>
請參閱此以了解如何制作三角形:https ://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_shapes_triangle-left
uj5u.com熱心網友回復:
試試這個!您想要的任何東西都在這里,但首先嘗試制作一個容器然后復制代碼! https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_shapes_triangle-left
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/436797.html
