Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

border image not showing in safari

Tags:

html

css

safari

border-image not showing up in Safari or on tablet and mobile devices. It's fine in FF, IE, Chrome and Opera.

Here's the HTML:

<div class="col-sm-4 ctas" id="togglelinks">
    <div class="rooms">
        <img src="images/bedroom1.jpg" alt="" class="img-responsive" />
        <h6>Room 1</h6>
        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam</p>
        <p><a class="btn togglee" target="one">MORE INFORMATION</a></p>
    </div>
</div>

and the css

.rooms {
    border: 15px solid transparent;
    color: #fff;
    padding: 5px;
    border-image: url("../images/paint-blk.png") fill 21 repeat;
}

A little more information: I'm using Bootstrap v3.0.3. The page is validating. In FireBug the borders are being brought through, colour, padding, but not the image.

like image 983
JCooke Avatar asked Jan 09 '14 16:01

JCooke


People also ask

Why is my border not showing up?

CSS Border Not Showing If you've set the shorthand border property in CSS and the border is not showing, the most likely issue is that you did not define the border style. While the border-width and border-color property values can be omitted, the border-style property must be defined.

What is border-image-source?

The border-image-source property specifies the path to the image to be used as a border (instead of the normal border around an element). Tip: If the value is "none", or if the image cannot be displayed, the border styles will be used.

What does border image slice do?

The border-image-slice property specifies how to slice the image specified by border-image-source. The image is always sliced into nine sections: four corners, four edges and the middle. The "middle" part is treated as fully transparent, unless the fill keyword is set.


2 Answers

I found this post while looking for a solution for the same problem with Safari 10.0. I was able to find a solution and wanted to share it in case somebody has the same problem. The problem was fixed by removing the border shorthand property and replacing it with border-style and border-width.

Here is my code before, NOT working:

 .borderWrap{

    border: solid 34px transparent;
    border-image: url(../images/spriteOneFrame.png) 34 34 round;
 }

And the new code working:

.borderWrap{

    border-style: solid;
    border-width: 34px;
    border-image: url(../images/spriteOneFrame.png) 34 34 round;
}
like image 77
roco15 Avatar answered Oct 12 '22 12:10

roco15


In Safari Version 10.1.1 no border-image is displayed at w3schools.com now in June 2017. There is a border-image-generator at border-image dot com (I hope, I am allowed to mention this here!), that works great at least for Safari, chrome an ff for mac. My example:

border-style: solid;
border-width: 5px;
-moz-border-image: url(border.png) 27 repeat;
-webkit-border-image: url(border.png) 27 repeat;
-o-border-image: url(border.png) 27 repeat;
border-image: url(border.png) 27 fill repeat;
like image 41
Mary Avatar answered Oct 12 '22 11:10

Mary