http://wpbtips.wordpress.com/
Normal (rectangular) borders were covered in Borders pt.1; this post focuses on borders with rounded corners.
But! keep in mind that rounded corners are of limited use: at the moment they don’t work in Internet Explorer or Opera. (If you’re viewing this post using either one of them, you’ll see the right color, thickness etc., but no curves.)
As explained in the previous post, you need a p tag for a single paragraph, a div tag for more than that; you need to set border thickness, type, and color, as well as text padding; plus you can add commands for background color, text formatting, etc.
The basic command for rounded corners is “border-radius:”, followed by a px number to determine how pronounced the curvature will be. Unfortunately, this feature isn’t standardized yet, so you have to add an array of separate commands to make it work with different browser engines (“border-radius:” preceded by “-moz-” for Firefox, Flock, and other mozilla-based browsers, by “-webkit-” for Safari, Chrome, and other webkit-based browsers, by “-khtml-” for khtml-based browsers).
Examples:
Code for this border:
<p style="border:4px solid #9fb6cd;border-radius:6px;-khtml-border-radius:6px;-moz-border-radius:6px;-webkit-border-radius:6px;padding:10px;">
TEXT_HERE
</p>
Code for this border:
<p style="border:4px solid #9fb6cd;border-radius:15px;-khtml-border-radius:15px;-moz-border-radius:15px;-webkit-border-radius:15px;background-color:#f3e88e;padding:10px;">
TEXT_HERE
</p>
You can apply that to each corner selectively. In that case you add “top” or “bottom” and “left” or “right” as shown in the following example (note difference in the moz command):
<p style="border:solid 6px #9fb6cd;border-top-left-radius:12px;-khtml-border-top-left-radius:12px;-webkit-border-top-left-radius:12px;-moz-border-radius-topleft:12px;border-top-right-radius:33px;-khtml-border-top-right-radius:33px;-webkit-border-top-right-radius:33px;-moz-border-radius-topright:33px;padding:10px;">
TEXT_HERE
</p>
The border-radius code can be manipulated to produce various shapes, including a full circle; example (no that’s not an image!):
OH!
Code:
<div style="border:solid 15px #9fb6cd;border-radius:100px;-khtml-border-radius:100px;-moz-border-radius:100px;-webkit-border-radius:100px;width:140px;height:140px;text-align:center;font-size:400%;color:#cd3278;line-height:140px;padding:15px;">
TEXT_HERE
</div>
To get a circle, you need to observe the following:
width = height [= line-height, for a vertically centered word]
padding number = border number
radius number = (width : 2) + (border x 2)
But, I repeat, don’t forget that none of this works in IE (no surprise…) or Opera. Also note that if you switch from html to visual in the WP editor, parts of the code may be stripped out, destroying the effect.
http://wpbtips.wordpress.com/