Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

:before and :after selectors on internet explorer

I have some css code that use :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;
}

The slide HTML 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 look like this, on Chrome: enter image description here

And internet explorer: enter image description here

On internet explorer developers tools all this css code is strikethrough, so I suppose that is being ignored. Is there a way to make this css work in internet explorer?

Website link.

like image 486
ThemesCreator Avatar asked Nov 07 '14 12:11

ThemesCreator


1 Answers

You don't need absolute positioning for the pseudo elements. You can achieve the desired layout with display:inline-block; on 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;
}

Tested on IE 11 but this should work on all versions supporting pseudo elements (IE8 +)

like image 196
web-tiki Avatar answered Sep 30 '22 16:09

web-tiki