General Question

Link's avatar

Curved borders in HTML/CSS?

Asked by Link (327points) June 22nd, 2009

How do Web designers create boxes with curved borders on their Web sites? What is the HTML/CSS code? Thanks in advance.

Observing members: 0 Composing members: 0

7 Answers

noyesa's avatar

The most common method involves one block level element with another block level element inside of it. The “bottom” element has a background image with no vertical repeat for the top left and right corners, and the element on top, which contains the content for the widget, has the bottom left and right. This way, as the box expands vertically, the corners move with it.

fireside's avatar

Download “Firebug” for Firefox and check out some of the elements on a page.
You definitely need an image for the rounded corner to look right.

StellarAirman's avatar

You can also do it with CSS and Javascript and several other methods besides images.

mirza's avatar

Basically you are trying to have Rounded corners. There’s a bunch of ways to do. Here’s one method I like but there are others. Here’s 25 Rounded Corners Techniques with CSS

richardhenry's avatar

When building Tweet My Gaming (have you seen it advertised in the sidebar on ;p) we actually decided to use the border-radius CSS property for WebKit and Mozilla-based browsers. In our opinion, the site looks totally acceptable in Internet Explorer and Opera (and other browsers that don’t have similar support), and Safari, Chrome and Firefox get a little extra visual reward.

The usage of the CSS properties is a lot like:

-webkit-border-radius: 4px;
-moz-border-radius: 4px;

With the first targeting Safari, Chrome and other modern WebKit-based browsers, and the second targeting Mozilla-based Gecko browsers.

Fred931's avatar You’ll thank me later.

Answer this question




to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
Knowledge Networking @ Fluther