html - 在 CSS 中解开三 Angular 形的 secret

标签 html css

谁能解释一下当 CSS 宽度和高度设置为 0 时它是如何形成一个三 Angular 形的。

.arrow-up {
  width: 0; 
  height: 0; 
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid black;
}

.arrow-down {
  width: 0; 
  height: 0; 
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 20px solid #f00;
}

.arrow-right {
  width: 0; 
  height: 0; 
  border-top: 60px solid transparent;
  border-bottom: 60px solid transparent;
  border-left: 60px solid green;
}

.arrow-left {
  width: 0; 
  height: 0; 
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right:10px solid blue; 
}
<div class="arrow-up"></div>
<div class="arrow-down"></div>
<div class="arrow-left"></div>
<div class="arrow-right"></div>

最佳答案

关于html - 在 CSS 中解开三 Angular 形的 secret ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39659164/

相关文章:

css - React css-loader style-loader IF 语句

javascript - 受正则表达式模式限制的 HTML 输入字段

javascript - 侧边栏不工作不知道为什么

jquery - 选择 2 : Adding an indicator to show more results (On a Mac)

jquery - 在隐藏的 div 中显示一个 div

css - 带有媒体查询的 div 中的 svg 放置

python - 在 css 中使用 Django 数字变量

html - 使动态大小的 div 在周围的 div 中溢出,之后有两个固定的 div

html - bootstrap 3 - 崩溃 'jump' 行为

javascript - 下拉列表 1 值自动选择下拉列表 2 值