border-image-generator
by kpdecker on Apr.04, 2010, under border-image-generator
Update: border-image-generator is not hosted on border-image.com. The previous URLs are configured to redirect to this url.
The CSS3 border-image property allows for some very cool and efficient design but after implementing them in both Mozilla for the Firebug search panel and WebKit for the Palm Facebook notifications badge, I’ve learned that they can be quite frustrating to properly tweak by hand.
Background
For those who have not been exposed to this property, it allows a single image to be used to style the borders and background of a particular element. In the example above, each section will map to a different border, corner, or the content background, allowing for a single element and image to provide styling the previously required significantly more of each.
Using these properties the following element can be rendered using simple semantic HTML and CSS.

<div class="stylishContent">Some stylish content</div>
.stylishContent {
display: inline-block;
border-width: 27px 27px 27px 27px;
-moz-border-image: url(http://www.w3.org/TR/css3-background/border.png) 27 27 27 27; -webkit-border-image: url(http://www.w3.org/TR/css3-background/border.png) 27 27 27 27;
border-image: url(http://www.w3.org/TR/css3-background/border.png) 27 27 27 27;
}
For more detail, John Resig has published an excellent writeup on the Mozilla implementation.
App
As noted above there is a bit of tweaking involved in getting these settings right. To ease some of this pain I’ve created the border-image-generator project, which allows for WYSIWYG editing of these properties. Rather than manually adjusting each parameter, border-image-generator allows the various parameters involved to be changed visually with instant preview of what these changes will look like in the current browser.
Seen in action demonstrating Resig’s examples here and here.
Features
- WYSIWYG editing of border-image properties
- Cross-browser border-image CSS generation
- URL-based State (History + Preview in multiple browsers)
It can be accessed through any of the following URLs:
Any issues or suggestions for improvements can be sent to myself or logged in the github issue tracker.
Warning
As a preliminary warning this is currently a vendor experimental feature but it is currently set to be included in the CSS3 specification. There are some significant differences between the vendor implementations and the W3C candidate, so some caution should be used. Border-image-generator attempts to handle these cases as defined by the spec, but many things could change between the current implementations and the release of CSS3 implementations in the wild.
Related Links:
3 Comments for this entry
2 Trackbacks / Pingbacks for this entry
-
Ajaxian » Border Image Generator Tool
April 5th, 2010 on 6:12 am[...] is what Kevin felt too, and to solve it he hacked up a border-image generator tool that gives you a WYSIWYG editing experience that generates the cross browser CSS for you. Take an [...]
-
Border Image Generator Tool | DesignerLinks | Home to Web design news, jQuery Tutorials, CSS tutorials, Web Designing tutorials, JavaScript tutorials and more!
April 5th, 2010 on 6:16 am[...] is what Kevin felt too, and to solve it he hacked up a border-image generator tool that gives you a WYSIWYG editing experience that generates the cross browser CSS for you. Take an [...]
April 5th, 2010 on 1:37 pm
This is fantastic.
You should totally grab border-image.com for this a la border-radius.com
:)
April 6th, 2010 on 8:52 am
That’s pretty great. Maybe you can add the ability to choose image, and to add the ability to choose the repeat mode between stretch, roundĀ andĀ repeat.
April 6th, 2010 on 12:31 pm
@paul, Good idea. Registered… now need to set it up :)
@ybart,
When you say choose image do you mean a browsing UI?
Repeat mode is on my list and tracked under issue 1