rounded corners with css

Making boxes with rounded corners

We can make nice boxes with rounded corners with css. The box will expand to fit the content inside.

"View source" to see the html and the css (in head) that made these boxes!

Here's how:

In your image program (like Photoshop or Gimp), make images for all the four corners, and the lines.

In your html page, make a box using the div classes that you see when you "view source" of this page.

In your css, make the styles, as you see in the css in the head when you "view source" of this page.

Oops - something goes wrong when box is very tall, and the browser window is smaller. I will check this out.

Explore the links below (and i will too) for other web pages that show how to make a box with a repeating edge image, — that should make things more flexible.

Want to know more about how it works?

See the links below for the deep explanations.

 

Know more

Explanation, example, with code
www.modxcms.com/simple-rounded-corner-css-boxes.html
Explains, shows code, plus comments from other folks.
Examples with code
www.alistapart.com/d/customcorners/step6.html
Various size boxes with rounded corners (and shading!)
"View source" to see how.
http://www.vertexwerks.com/tests/sidebox/
Nice rounded corners with shading; css on the page.