0

I have the following CSS to create triangles:

.triangle-up {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 7.5px 10px 7.5px;
    border-color: transparent transparent #58BE23 transparent;
    margin-bottom: 15px;
    margin-let: 2px;
    display: inline-block;
    webkit-transform: rotate(360deg);
}

.triangle-down {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 7.5px 0 7.5px;
  border-color: #F44242 transparent transparent transparent;
  margin-bottom: 15px;
  margin-right: 2px;
  display: inline-block;
  webkit-transform: rotate(360deg);
}

My HTML is like so:

<script>
    document.getElementById("p5").className = "triangle-up"
</script>
Here is a triangle<i class="triangle-down" id="p5"></I>

I want to replace triangle-down with triangle-up. It doesn't seem to be working though. What am I doing wrong here?

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
Kex
  • 8,023
  • 9
  • 56
  • 129

0 Answers0