Images can be assigned to borders based on a single image file. The border property must be set.
Compatibility
-moz-border-imageFirefox 4+
-webkit-border-imageSafari 5+
-o-border-imageOpera 11+
border-imageSafari 6+, Chrome 15+
Not supported by Internet Explorer. For detailed compatibility info see caniuse.com. For a better understanding of the admittedly difficult syntax see border-image.com.
2 Sets the size of the areas that are taken to draw border. Can consist of up to four values each representing one side of the border. General shorthand rule applys.
3(Optional, separated by a slash) Border width. Can be different from value 2 and the border-width property set. General shorthand rule applys.
4(Optional, separated by a slash) Specifies how the image is fitted to the four sides of the border. Possible values are: stretch (default), round and repeat (see examples). If one value is set it is taken for all four sides of the border, with two value the first applys to top/bottom and the second to left/right. This value has no effect on the corners.
x The live view can be examined using an element inspector like Firefox’s Firebug. Many browsers already have such an inspector build in. In each case right click on the example and then select “Inspect element”. Now an area in your browser opens where you see the HTML code of the example on the left side and the CSS on the right side for further investigation.
Forgive me if I am simply mis-reading your compatibility charts, but I thought you’d like to know that Safari 5 does indeed support the official syntax for border-radius. In other words, there is no longer a need for -webkit-border-radius in Safari 5.
http://www.css3files.com Christian Krammer
Thanks for the tip Cornell! The change of the prefix must have happened in version 5.0.4 of Safari. I’ve noticed shortly that it has been released. Pity that they don’t auto update their browser or at least give a note to update as I don’t use this browser very often.
Anyway I have adjusted the browser chart above.
Cornell Campbell
That was quick! Thanks. They do sort-of auto update the browser. Whenever the Apple Software Update runs (I think weekly, or bi-weekly maybe?) it will notify you if there is a Safari update. But yeah, it would be nice if they did it on start-up or something like that.
Side note, I really like the site. Well done!
http://www.css3files.com Christian Krammer
It was my pleasure! And thanks for the compliment.
Never noticed that there is something like an auto-update. I use I quite long now and new got a note to update. I should make it a habit to regularly check every browser (except Chrome ) if there is an update.
Are you on Twitter by the way? Maybe you want to have a look at @edge0703.
Cornell Campbell
I am indeed on Twitter. I’ll give @edge0703 a look. Thanks
Syed Sheheryar
I was trying the border-radius while using the HTML5 schema, it was not working … then I used the previous HTML , it worked fine.
http://www.css3files.com Christian Krammer
Could you please further describe your problem Syed? I’d love to help you!
http://betonufc.info strikeforce betting
Awsome article !! What cms do you use on your www ?
http://www.css3files.com Christian Krammer
Thanks for the compliment. As noted in the footer I use WordPress. It’s sometimes a little bit bloated and slow but otherwise a great and feature-rich CMS.
Christopher San-Claire
Great job there, I’m loving the examples, be great the day we don’t have to use the browser specific making all official syntax.
I’m in the process of relearning CSS & HTML after long long absence and you have been great help to me with css3files.com Christian., many thanks
@Cornell Campbell: I myself don’t use safari being on window but its there for testing and quicktime so it do’s offer and update often.
@Strikeforce Betting: as Christian says “WordPress if feature -rich CMS and can be bloated” depending on what you are after I learning ExpresionEngine woth checking it out.
http://www.css3files.com Christian Krammer
Thank you very much for the compliment Christopher! I am really pleased that I could help you at relearning CSS and HTML.
Christopher San-Claire
Your welcome, and grates on your iPad 2… So it on twitter this afternoon…
http://myindigolives.wordpress.com/ Ellie K
I wonder why you don’t receive the Apple Software updates, Christian. That is odd indeed. I use Windows 7, receive Apple updates based on my use of iTunes (own none of Apple’s other very nice products). I use Safari only for checking cross-browser compatibility. I live in the U.S.A. mainland, am not sure where prior commenter Cornell Campbell is, but noticed that you are in Austria. That should make no difference though.
Like Cornell, I receive an Apple Software update notice at least every other week (fortnightly?) although Safari browser updates are not released that often. My browser of choice is Chrome, and I laughed at your reference to update frequency!
http://www.css3files.com Christian Krammer
Well, I don`t use iTunes at work so there is no chance for me to get these update reminders. Since I also use Safari very rarely (just to check sites sometimes like you) I might miss some notes from time to time. But overall it’s not a big affair. What’s Twitter for if not to be always up-to-date at browser development.
Reno Octa Achmad Fauzi
Wow, it`s good!
nanz
Wow amazing job and I just love the design of this website. I am a rookie at CSS and trying to catch up
http://www.webexstudios.com webexstudios
Thank you for this Post ! Nice work!
André
Thanks for these
milad
I like it!
http://twitter.com/Flocke Jens Grochtdreis
Android-Browser on Android 2.3.x does not need -webkit-prefix but it does ignore border-radius in percentage.
Sanil Shinde
Hi ,
I am trying to apply border-radius to div,which have border with gradient color.
But it is not allowing me to apply border-radius.
Below is my code snippet.
The problem is that border-radius doesn’t work when a border-image is applied. I’ve made a quick example to showcase that: http://codepen.io/edge0703/pen/hmGfL
If you remove border-image and just apply a simple border then border-radius works.
Sanil Shinde
Thanks for reply.
is their any other way to add border color as gradient
You could use a pseudo-element to set up a layer behind the actual content, which has a gradient applied. Of course that doesn’t work in older IEs (just like border-image).