: before and: after selectors in Internet Explorer

I have css code that uses: before and: after selectors:

.caption-wrap .line-3:before,
.caption-wrap .line-3:after {
    content: " ";
    position: absolute;
    width: 50px;
    height: 5px;
    border-top: 1px solid #FFFFFF;
    border-bottom: 1px solid #FFFFFF;
}
.caption-wrap .line-3:before {
    margin: 7px 0 0 -60px;
}
.caption-wrap .line-3:after {
    margin: 7px 0 0 10px;
}

HTML slide markup:

<li>
    <img src="images/mountains.jpg" class="parallax-bg" alt="">
    <div class="overlay"></div>
    <div class="container hidden-xs">
        <div class="caption-wrap">
            <p class="line-1">we are</p>
            <h1 class="line-2 dashed-shadow">
                MINIMAL</h1>
                <h4 class="line-3">Design | Develpment | Success</h4>
                <p class="line-5">
                    <a href="#">codenpixel</a>
                    <a href="#">retrograde</a>
                </p>
                <p class="line-6">2014</p>
        </div>
    </div>
</li>

This is similar to Chrome: enter image description here

And internet explorer: enter image description here

In the tools of the Internet Explorer developers, all this css code is encrypted, so I believe that this is ignored. Is there any way to make this css work in Internet Explorer?

Website link .

+4
source share
1 answer

You do not need absolute positioning for pseudo-elements. You can achieve the desired layout using display:inline-block;for pseudo-elements:

Demo

CSS:

.caption-wrap .line-3:before,
.caption-wrap .line-3:after {
    content: " ";
    display:inline-block;
    width: 50px;
    height: 5px;
    border-top: 1px solid #FFFFFF;
    border-bottom: 1px solid #FFFFFF;
    margin: 7px 10px 0;
}

IE 11, , (IE8 +)

+5

All Articles