I'm in the process of creating a div that has a unique design like this.
https://i.sstatic.net/cHJNY.png
.triangle-area {
width: 100%;
height: 150px;
}
.triangle1 {
width: 100%;
height: 50px;
border-width: 50px 50px 0 50px;
border-color: red transparent transparent transparent;
border-style: solid;
overflow: hidden;
display: block;
position: absolute;
box-sizing: border-box;
}
.triangle2 {
width: 50px;
height: 150px;
border-width: 50px 50px 50px 0;
right: 0;
border-color: transparent blue transparent transparent;
border-style: solid;
overflow: hidden;
display: block;
position: absolute;
box-sizing: border-box;
}
.triangle3 {
width: 100%;
height: 50px;
border-width: 0 50px 50px 50px;
bottom: 0;
border-color: transparent transparent green transparent;
border-style: solid;
overflow: hidden;
display: block;
position: absolute;
box-sizing: border-box;
}
.triangle4 {
width: 50px;
height: 150px;
border-width: 50px 0 50px 50px;
border-color: transparent transparent transparent yellow;
border-style: solid;
overflow: hidden;
display: block;
position: absolute;
box-sizing: border-box;
}
<div class="triangle-area">
<div class="triangle1"></div>
<div class="triangle2"></div>
<div class="triangle3"></div>
<div class="triangle4"></div>
</div>
My challenge now is figuring out how to prevent the transparent parts of each border line from overlapping. I also aim to have each triangle div act as a button with a hover effect, coloring the entire border line when hovered rather than just a portion.