Forums
View unanswered posts | View active topics It is currently Wed Jun 19, 2013 3:11 am



Reply to topic  [ 4 posts ] 
 Unable to get border-image and background-image at same time 
Author Message

Joined: Tue Oct 25, 2011 3:40 pm
Posts: 2
Post Unable to get border-image and background-image at same time
I have not been able to apply a border-image at the same time as a background image in IE8 and IE9.

I'm using Beta5 right now.

My image is a 50px X 50px PNG image, with a 2px border all the way around and a transparent center.

We conditionally include an IE only stylesheet.

My regular CSS (all browsers) is as follows:

.BorderContainer
{
background: #e2e3e3 url("/path/bg_Container.png") repeat-x left top !important;

-moz-border-image: url('/path/bg_2ColorBorderImage.png') 2 2 2 2 repeat repeat;
-webkit-border-image: url('/path/bg_2ColorBorderImage.png'') 2 2 2 2 repeat repeat;
border-image: url('/path/bg_2ColorBorderImage.png'') 2 2 2 2 repeat repeat;
}

My IE only CSS (included only if IE is the browser) is as follows:

.BorderContainer
{
border-image: url('/path/bg_2ColorBorderImage.png') 2 2 2 2 repeat repeat;
behavior: url('/path/pie.htc');
position: relative;
}

What I've noticed is that in the latest FF (7.0.1)/Chrome 14 this method works. The image border is a little fuzzy (I specified 2px for every dimension and it makes it 3px everywhere, I'm assuming it's in the implementation.

In IE8 and IE9, the background property is used and the border-image property seems to be ignored.

As soon as I comment out the background property, then I see the border-image in IE.

Is this a bug? Or am I applying things incorrectly?


Tue Oct 25, 2011 3:55 pm
Profile

Joined: Wed Jul 14, 2010 11:46 am
Posts: 1401
Post Re: Unable to get border-image and background-image at same
I suspect it's your use of !important in your background property. PIE has to be able to modify the background of the element... for IE6-8 it has to set it to transparent so it can re-render the border-image behind the element, and in IE9 it has to be able to add the border-image as a layer in the background. If you set !important on your background, then PIE is unable to override it.

Here's a screenshot of IE8 rendering a border-image with a background, so this does work.
http://cl.ly/3m1E3b353L3X1M14193d

Also be aware that in IE6-8 only the 'stretch' value is supported, you cannot use 'repeat'. IE9 will do 'repeat' correctly.


Wed Oct 26, 2011 4:04 pm
Profile

Joined: Tue Oct 25, 2011 3:40 pm
Posts: 2
Post Re: Unable to get border-image and background-image at same
Interesting I'll try that in an isolated solution for proof of concept purposes.

I had the !important flag on that rule because our CSS file is being applied before the included CSS with a particular plugin so the order matters in our case and in order to supercede this file, an important flag needed to be added.

Does anyone know if this difference is planned on being addressed, or is the way our system is currently not compatible with how border-image with a background has been implemented in CSS3Pie?


Sat Oct 29, 2011 8:53 am
Profile

Joined: Wed Jul 14, 2010 11:46 am
Posts: 1401
Post Re: Unable to get border-image and background-image at same
Using !important will always be a problem, because there is no way that PIE can override it. If PIE can't override it, then it can't render.

An alternative to !important might be to change the selector to increase its specificity above that of the plugin CSS.


Sat Oct 29, 2011 9:22 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: Bing [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.