Web Design Forum  
 
Go Back   Web Design Forum > Web and Graphic Design > Web Design

Reply
 
LinkBack Thread Tools Display Modes
Old 06-05-2011, 08:11 AM   #1
New Member
 
Join Date: Jun 2011
Posts: 1
Default how to make curve corner using css

In this tutorial , we will make css curved corners using a very easy and simple technique .

In the past , people used images to make a curved corners , but now we will make it without any image .

Let’s start how to make css curved corners :



First of all , I will make this HTML code :-

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>

<title>css curved corners</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<link media="screen" type="text/css" rel="stylesheet" href="css-curved-corners.css" />

</head>

<body>

<div id="curved-corner-example">

</div>

</body>

</html>







Ok , now we won’t change the HTML , we will just change the css code



Make a css file (I called it css-curved-corners.css)

and put this code in it :-

#curved-corner-example {

height: 400px;

width: 150px;

background: #81b6b7;

margin: 25px auto;

padding: 8px;

}



And you will have something like that :-


Ok , now we want to make curved corners , so just add this line into out css code



border-radius: 20px 20px 20px 20px;



and our CSS code will be :



#curved-corner-example {

height: 400px;

width: 150px;

background: #81b6b7;

margin: 25px auto;

padding: 8px;

border-radius: 20px 20px 20px 20px;

}

And it will be something like that

And you will have something like that :-


Ok now we want to make some changes , I want to curve some corners more than the others . so I’ll change the css code into this :



#curved-corner-example {

height: 400px;

width: 150px;

background: #81b6b7;

margin: 25px auto;

padding: 8px;

border-radius: 20px 2px 20px 2px;

}



As you see , 2 corners are curved with 20px radius , and the others are curved with 2px radius .



And it will be :-

And you will have something like that :-


Finally , you can combine this technique with other techniques we used in previous lesson , I’ll combine it with shadow and border , so our code will be :-



#curved-corner-example {

height: 400px;

width: 150px;

background: #81b6b7;

margin: 25px auto;

padding: 8px;

border-radius: 20px 2px 20px 2px;

border-style:solid;

border-width:1px;

-moz-box-shadow: 3px 3px 10px #000;

-webkit-box-shadow: 3px 3px 10px #000;

box-shadow: 3px 3px 10px #000;

}

and the result :-

And you will have something like that :-



End of the tutorial .

Source :- CSS Curved Corners

for more Tutorial , you can visit the source .

thanks
grookseo is offline   Reply With Quote


Old 06-05-2011, 05:34 PM   #2
New Member
 
Join Date: May 2010
Location: The Netherlands
Posts: 15
Send a message via MSN to RoboticPro
Default

You know that not every browser supports it?
Including the most used IE before version 9
so it's better to do a browser detection and
on that select your way to use it.
RoboticPro is offline   Reply With Quote
Old 06-06-2011, 01:46 PM   #3
New Member
 
Milagros Kornre's Avatar
 
Join Date: Jun 2011
Posts: 5
Default

I do not think this is supported in IE. Correct me if i am wrong
Milagros Kornre is offline   Reply With Quote
Old 06-06-2011, 03:19 PM   #4
Silver Member
 
Join Date: Mar 2011
Posts: 231
Default

wow.. nice.. i just knew about this one today.. thanks a lot..!
computerGeek is offline   Reply With Quote
Old 06-07-2011, 09:02 AM   #5
New Member
 
PannaDraws's Avatar
 
Join Date: Jun 2011
Posts: 1
Default

Actually it's not supported in IE... I usually check css3.info for the latest support news. Anyway, I also use a lot this to get nice rounded corners, or even circles.
__________________
PannaDraws
http://pannadraws.com
http://pannarajzol.hu
PannaDraws is offline   Reply With Quote


Old 06-07-2011, 10:27 AM   #6
Platinum Member
 
Join Date: Sep 2010
Posts: 509
Default

actually it is supportedin ie9 and10
http://caniuse.com/#search=border-radius.
d a v e is offline   Reply With Quote
Old 06-09-2011, 10:21 AM   #7
Bronze Member
 
Join Date: Feb 2010
Location: Satellite-Town, Lagos, Nigeria, West-Africa.
Posts: 89
Default

Weather it is supported by IE or not, the fact remains that, those of us who didnt know how to go about it have learned something new.
However, those who say it is not supported by IE should tell us what to do: Maybe we use Safari, Firefox of others.

Thanks,
Golden Waters.
goldenwaters is offline   Reply With Quote
Old 06-09-2011, 10:55 AM   #8
Bronze Member
 
Join Date: Jun 2011
Posts: 27
Default

Nice tutorial. Thanks for sharing
rahmanpaidar is offline   Reply With Quote
Old 06-09-2011, 06:27 PM   #9
Super Moderator
 
Join Date: Oct 2008
Location: Arizona, USA
Posts: 1,053
Default

You will need to "-moz" prefix for FireFox for border radius. All other css3 supporting browsers will be fine with the standard property.
__________________
John Darling
Graphic / Web Designer
SmarterTools Inc.
(877) 357-6278
www.smartertools.com
PixelPusher is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:03 PM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.