I am trying to create triangle shaped pointer/border on a horizontal line.
Here is an example of what I am trying to achieve:

I tried manipulating the top border of a div, but everything I've done so far doesn't work at all.
I am trying to create triangle shaped pointer/border on a horizontal line.
Here is an example of what I am trying to achieve:

I tried manipulating the top border of a div, but everything I've done so far doesn't work at all.
There are several ways to achieve that and it probably depends on your layout. One solution is to use a rotated element with borders on two sides.
.triangle {
  background: green;
  border: 2px solid white;
  border-width: 2px 2px 0 0;
  transform: rotate(-45deg);
}
.box {
  background: green;
  width: 400px;
  height: 80px;
  position: relative;
}
.line {
  height: 39px;
  border-bottom: 2px solid white;
}
.triangle {
  background: green;
  border: 2px solid white;
  border-width: 2px 2px 0 0;
  transform: rotate(-45deg);
  position: relative;
  left: 300px;
  top: 28px;
  width: 20px;
  height: 20px;
}
<div class="box">
  <div class="line">
    <div class="triangle">
      </div>
    </div>
  </div>
You can use :before and :after pseudo-elements:
body{
    background:black;
}
div{
    border-top:1px solid green;
    position:relative;
    margin-top: 100px;
}
div:before{
    content: '';
    position:absolute;
    left: calc(90% - 20px);
    top: -9px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 10px 10px 10px;
    border-color: transparent transparent black transparent;
    z-index: 10;
}
div:after{
    content: '';
    position:absolute;
    right:10%;
    top: -10px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 10px 10px 10px;
    border-color: transparent transparent green transparent;
}
<div></div>
Basiclly, there are two triangles, one is in the color of the background with larger z-index, and the other one is in the color of the border.
Update
As @misterManSam mentioned, you can achieve it without using z-index - fiddle
This can be achieved using a single div element.
Here's a quick demo:
html,body{background:green; height:100%;padding:0;margin:0;overflow:hidden;}
.line {
  margin-top: 50px;
  height: 5px;
  width: 80%;
  background: #fff;
  position: relative;
  box-sizing: border-box;
}
.line:after,
.line:before {
  content: "";
  position: absolute;
}
.line:after {
  left: calc(100% + 2px);
  height: 25px;
  width: 25px;
  top: -13px;
  border-top: 5px solid #fff;
  border-left: 5px solid #fff;
  transform: rotate(45deg);
}
.line:before {
  height: 100%;
  top: 0;
  left: calc(100% + 34px);
  width: 20%;
  background: inherit;
}
<div class="line"></div>
.box {
  margin-top: 100px;
  height: 50px;
  background: green;
  position: relative;
}
.box .line {
  position: absolute;
  top: 50%;
  left: 5px;
  right: 5px;
  margin-top: -1px;
  height: 2px;
  background: white;
}
.box .triangle {
  position: absolute;
  width: 0;
  height: 0;
  border-bottom: 8px solid white;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid transparent;
  top: 50%;
  right: 50px;
  margin-top: -15px;
}
.box .triangle .inner {
  position: absolute;
  top: -4px;
  left: -6px;
  width: 0;
  height: 0;
  border-bottom: 6px solid green;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid transparent;
}
<div class="box">
  <div class="line"></div>
  <div class="triangle"><div class="inner"></div></div>
</div>