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其他 #5

Open
AILINGANGEL opened this issue May 30, 2019 · 0 comments
Open

CSS其他 #5

AILINGANGEL opened this issue May 30, 2019 · 0 comments

Comments

@AILINGANGEL
Copy link
Owner

1.用css画一个三角形

<div class="div1"></div>
  • 第一步: 设置边框和width,height为0
.div1 {
  width: 0;
  height: 0;
  border-right: 100px solid red;
  border-left: 100px solid green;
  border-top: 100px solid blue;
  border-bottom: 100px solid pink;
}

image

  • 第二步: 通过控制上下左右的border来控制想要的三角形
.div1 {
  width: 0;
  height: 0;
  border-right: 100px solid transparent;
  border-left: 0px solid transparent;
  border-top: 100px solid blue;
  border-bottom: 0px solid pink;
}

image

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