Use ":last-Child:after" in Internet Explorer 8

Asked

Viewed 98 times

7

I have a graph where some elements are generated via CSS, namely the trace below the quantity scale:

Captura de Tela

CSS Used:

#results .chart-scale li{
    font-size:16px;
    line-height:18px;
    padding-top:38px;
    font-family:'latolight', sans-serif;
    position:relative;
}
#results .chart-scale li:after{
    content: "";
    display:block;
    height:1px;
    width:28px;
    background-color:#0d3e38;
    opacity:0.3;
    position:absolute;
    bottom:0;
    right:-14px;
}
#results .chart-scale li:last-child:after{
    background-color:transparent;
}

Problem

In older browsers like IE8, the last statement li:last-child:after where the background color is retained for the initial amount that is zero, being represented as empty in the chart does not work:

Captura Tela IE8

Question

Example in Jsfiddle

How can I handle using the CSS declaration :last-child:after in Internet Explorer 8 ?

If relevant, the chart already makes use of jQuery, so a solution using Javascript is also feasible.

1 answer

3


You can make this css statement through Jquery:

$('#results .chart-scale li:last-child:after').css('background-color','transparent');

Browser other questions tagged

You are not signed in. Login or sign up in order to post.