Skip to content
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 面试 #37

Open
ChelesteWang opened this issue Oct 24, 2021 · 0 comments
Open

CSS 面试 #37

ChelesteWang opened this issue Oct 24, 2021 · 0 comments

Comments

@ChelesteWang
Copy link
Owner

CSS 画三角

原理:border 属性绘制的边框为梯形,只保留一面其他的颜色都设置为transparent透明

span {
    width: 0;
    height: 0;
    border-top: 40px solid transparent;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 40px solid #ff0000;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant