Does anyone know how I can assign a border in a triangle made with css?

3

The code is this:

div {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 40px 30px 40px;
    border-color: transparent transparent #007bff transparent;
}
<div/>

I want to create a border on it.

    
asked by anonymous 25.07.2016 / 23:28

1 answer

3

You can make a triangle inside another:

.triangle {
  position: relative;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 44px 34px 44px;
  border-color: transparent transparent #007bff transparent;
}
.inner-triangle {
  position: absolute;
  top: 6px;
  left: -38px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 38px 28px 38px;
  border-color: transparent transparent #f09 transparent;
}
<div class="triangle">
  <div class="inner-triangle"></div>
</div>
    
25.07.2016 / 23:37