You are here:   Home
Register   |  Login

Captured Technology - Blog

Minimize

CSS Rounded Corners

May 7

Written by:
5/7/2009 2:11 PM  RssIcon

CSS Rounded Corners

I have been creating my own rounded corners using a table structure and 6 images on a couple of web sites that we are building. But I started to wonder if there was an easier way to round corners without all the images and etc. Today I came across benogle and his CSS Rounded Corners demonstration which is one really nice way to create what used to require quite a bit of image slicing.

He creates a number of classes with each class having a slightly smaller margin. Then combine the different classes utilizing a bold tag with the content in div tags. Here is a simple example:

.b1f, .b2f, .b3f, .b4f{font-size:1px; overflow:hidden; display:block;}
.b1f {height:1px; background:#ddd; margin:0 5px;}
.b2f {height:1px; background:#ddd; margin:0 3px;}
.b3f {height:1px; background:#ddd; margin:0 2px;}
.b4f {height:2px; background:#ddd; margin:0 1px;}
.contentf {background: #ddd;}
.contentf div {margin-left: 5px;}
<b class="b1f"></b><b class="b2f"></b><b class="b3f"></b><b class="b4f"></b>
    <div class="contentf">
        <div>Round FILL!!</div>
    </div>
<b class="b4f"></b><b class="b3f"></b><b class="b2f"></b><b class="b1f"></b>

Tags:
Categories:

8 comment(s) so far...


Gravatar

Re: CSS Rounded Corners

A nice solution.

Hopefully soon we'll be able to use the CSS only method once enough people move on from the older browsers...

By cookery blog on   5/12/2009 6:53 AM
Gravatar

Re: CSS Rounded Corners

Most codes I usually find are the ones that would require me to download softwares, and I don't like that. Thank you for this post :-)

By precious_19b on   5/12/2009 7:34 PM
Gravatar

Re: CSS Rounded Corners

I have been working with this code a lot this week. I made some modifications and also recreated the html code in aspx code. Very interesting.

By Steve on   5/14/2009 4:40 PM
Gravatar

Re: CSS Rounded Corners

It would be interesting to see the updates you have made.

The code already looks pretty tidy.

By email marketing software on   5/15/2009 10:42 AM
Gravatar

Re: CSS Rounded Corners

You are voted!!
Track back from WebDevVote.com

By WebDevVote.com on   6/15/2009 5:14 AM
Gravatar

Houston car classifieds

This is really a nice and good way to create rounded corners without using images. Excellent post

By smith on   7/10/2009 3:04 AM
Gravatar

Re: CSS Rounded Corners

Hopefully soon we'll be able to use the CSS only method once enough people move on from the older browsers..

By club penguin cheats on   12/13/2009 5:40 AM
Gravatar

Re: CSS Rounded Corners

The new rounded corner support with VS 2010 is something everyone is looking forward to.

By Steve on   12/13/2009 6:24 PM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment   Cancel 

FaceBook

Minimize

Mobile Version

Minimize
Add CapturedTech - Technology Mippin widget

Translate

Minimize

Sponsors

Minimize

Recent Comments

Minimize
Re: Microsoft Test Bounties
I had spent a good deal of my time looking for someone to explain this subject clearly and I have really enjoyed reading your blog posts and I collected a lot of interesting things as well as I done a research on the subject and learn most peoples will agree with your blog.
Re: 10 Ways to Source Great Sales Leads
Hoovers.com, that have contact information for tens of millions of businesses. If necessary, you can work with these companies' research teams to order lists specifically tailored to your organization's sales needs.
Re: Microsoft Test Bounties
To find bugs and showing it to microsoft is quite admirable. Keep blogging more i will appreciate.
Re: Microsoft Test Bounties
Testing a software and giving out the errors to microsoft is amazing. Very good thing to do. One can do this in free time.
Re: Reindexing SQL Server Tables
Discussed about the SQL server and more interesting matter discussed in the post because in the post define about the SQL server table so that can be know that and able to understand regarding post.

u comment, i follow