#triangle-up {
width
:
0
;
height
:
0
;
border-left
:
50px
solid
transparent
;
border-right
:
50px
solid
transparent
;
border-bottom
:
100px
solid
red
;
}
The question is how these few lines can create a triangle?
Next we give the answer and the detail illustration to this question
We need to consider the Box Model of HTML, here we see content and padding as content and we ignore margin, then the box model can be seen as
Author : Source : http://coolshell.cn/articles/6913.html#more-6913