Skip to content

Instantly share code, notes, and snippets.

@jasonzhouu
Last active March 11, 2020 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonzhouu/6c650c0abe966e184a0b36dd654adb45 to your computer and use it in GitHub Desktop.
Save jasonzhouu/6c650c0abe966e184a0b36dd654adb45 to your computer and use it in GitHub Desktop.
用border创建小三角形

image

原理:

  • 创建一个width, height都为0,从而border共同构成一个正方形;
  • 将border的颜色设置为transparent,存在但是看不到;
  • 设置top border的颜色,使其存在且可以看到,它与相邻侧的border的边界是45°斜角,表现为三角形。

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment