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:
And internet explorer:
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.
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 +)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With