-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCSS-border-triangle.html
58 lines (57 loc) · 1.36 KB
/
CSS-border-triangle.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CSS Triangle</title>
<style>
.in {
width: 0px;
height: 0px;
margin-left: 5%;
padding: 5px;
/* background-color: blueviolet; */
border: 200px salmon solid;
/* border-color: seagreen red black chartreuse; value: top>right>bottom>left; */
border-color: transparent transparent black transparent;
/* transform: rotate(180deg); */
}
.out {
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, 50%);
padding: 5px;
width: 500px;
height: 500px;
/* background: tomato; */
}
/* Another way*/
/* .out2 {
position: relative;
}
.in2 {
border-color: transparent transparent transparent #ec0303;
border-style: solid;
border-width: 50px 0 50px 95px;
height: 0;
width: 0;
position: absolute;
left: 51px;
margin-top: 100px;
margin-left: 40px;
} */
</style>
</head>
<body>
<div class="out">
<div class="in"></div>
</div>
<br />
<br />
<br />
<div class="out2">
<div class="in2"></div>
</div>
</body>
</html>