-
Notifications
You must be signed in to change notification settings - Fork 634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
面试题:使用 CSS 画一个三角形 #123
Comments
通过border模拟实现当div 的宽高为0,存在边框的时候,四条边框的中心将会是一个点,通过设置其他三条边框的透明度,实现三角形。 div{
width:0;
height:0;
border-width:8px;
border-style:solid;
border-top-color: transparent;
border-right-color: transparent;
border-bottom-color: transparent;
border-left-color: red;
} |
显示不出来需要再加一个属性: border-style:solid; |
啊 漏了..补上 |
Using clip-path property .triangle { |
前端小技巧:边框写三角形
The text was updated successfully, but these errors were encountered: