AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP, SQL

CSS rounded corners button


<< Previous Page
HTML tutorial
Next Page >>
HTML tutorial

CSS Tutorial » CSS rounded corners button

How to create a Button with Rounded Corners using CSS

To create a rounded corners button, we have to use CSS border-radius property for a button. This property in the specified selector is used to set the rounded coners (boundary radius) of the item..

Syntax:

.selector_name {
border-radius: value;
}
/* In this case it sets border-radius value to all 4 corners */

Let's have an example and working on it: first button has border-radius:10px and second has border-radius:16px and third has border-radius:20px

Example of buttons srounded corners image

Browser Support CSS button rounded corners

Element chrome browser
 Chrome
ie browser
 IE
firefox browser
 Firefox
opera browser
 Opera
safari browser
 Safari
Browser Support option Yes Yes Yes Yes Yes

 

CSS rounded corners button

How do you make a button with rounded corners?
The create this we use CSS Style with a selector called button1, button1 ..... and we add property border-radius: with different values.

For a better understanding we present an example:

Example (this is HTML - PHP editor, change text, values on this window)
<!DOCTYPE html>
<html>
<head>
<title>css rounded corners button - example</title>
<style>
.button {
border: none;
color: white;
padding: 10px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 14px;
margin: 8px 4px;
cursor: pointer;
font-weight: bold;
}
.button1 {
background-color: #09C;
border-radius: 4px;
}
.button2 {
background-color: #060;
border-radius: 8px;
}
.button3 {
background-color: #F00;
border-radius: 12px;
}
.button4 {
background-color: #CCC;
border-radius: 16px;
}
.button5 {
background-color: #00F;
border-radius: 50%;
}

</style>
</head>
<body>

<h2>How do you make a button <br />
with rounded corners?</h2>
Rounded corners to a button with border-radius property:</b><br />
<button class="button button1"> button 4px</button>
<button class="button button2">Procced 8px</button>
<button class="button button3">Delete 12px</button>
<button class="button button4">Default 16px</button>
<button class="button button5">round 50%</button>

<p>&nbsp;</p>
<button style=" background-color:#09C; border:none; margin:10px;
padding: 10px 20px; font-weight:bold; color:#FFF; font-size:16px;
border-radius:10px">Button</button>
<button style=" background-color:#060; border:none; margin:10px;
padding: 10px 20px; font-weight:bold; color:#FFF; font-size:16px;
border-radius:10px">Procced</button>
<button style=" background-color:#F00; border:none; margin:10px;
padding: 10px 20px; font-weight:bold; color:#FFF; font-size:16px;
border-radius:10px">Delete</button>

</body>
</html>

Related subjects:
CSS rounded coners CSS rounded corners image CSS rounded corners button

Tags: How do you make an oval shape in CSS?, How do I create a curved div in CSS?

 

CSS rounded corners button link

To make rounded coners for we used CSS Style for .button { border: none; color: white; padding: 10px; text-align: center; text-decoration: none; display: inline-block; font-size: 14px; margin: 8px 4px; cursor: pointer; font-weight: bold;}

Example (this is HTML - PHP editor, change text on this window)

<!DOCTYPE html>
<html>
<head>
<title>css rounded corners button link - example</title>
<style>
.button {
border: none;
color: white;
padding: 10px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 14px;
margin: 8px 4px;
cursor: pointer;
font-weight: bold;
}
.button1 {
background-color: #09C;
border-radius: 4px;
}
.button2 {
background-color: #060;
border-radius: 8px;
}
.button3 {
background-color: #F00;
border-radius: 12px;
}
.button4 {
background-color: #CCC;
border-radius: 16px;
}
.button5 {
background-color: #00F;
border-radius: 50%;
}

</style>
</head>
<body>

<h2>How do you make a button link <br />
with rounded corners?</h2>
<p>Rounded corners to a button link with border-radius property:</b></p>
<p>
<a class="button button1" href="https://www.agernic.com">
Agernic tutorial</a>
<a class="button button2" href="https://www.agernic.com">
Agernic tutorial</a>
<a class="button button3" href="https://www.agernic.com">
Agernic tutorial</a>
<a class="button button4" href="https://www.agernic.com">
Agernic tutorial</a>
<a class="button button5" href="https://www.agernic.com">
Agernic tutorial</a>
</p>
</body>
</html>

 

Round buttons with shadow effect

Webmasters often use the CSS box-shadow property to improve the design of a web page to add a shadow effect around an element's frame.

Example (this is HTML - PHP editor, change text on this window)

<!DOCTYPE html>
<html>
<head>
<title>css rounded corners button link shadow - example</title>
<style>
.button {
border: none;
color: white;
padding: 10px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 14px;
margin: 8px 4px;
cursor: pointer;
font-weight: bold;
box-shadow: 10px 5px 5px gray;
}

.button1 {
background-color: #09C;
border-radius: 4px;
}
.button2 {
background-color: #060;
border-radius: 8px;
}
.button3 {
background-color: #F00;
border-radius: 12px;
}
.button4 {
background-color: #CCC;
border-radius: 16px;
}
.button5 {
background-color: #00F;
border-radius: 50%;
}

</style>
</head>
<body>

<h2>How do you make a button shadow link <br />
with rounded corners?</h2>
<p>Rounded corners shadow to a button link with border-radius property:</b></p>
<p>
<a class="button button1" href="https://www.agernic.com">
Agernic tutorial</a>
<a class="button button2" href="https://www.agernic.com">
Agernic tutorial</a>
<a class="button button3" href="https://www.agernic.com">
Agernic tutorial</a>
<a class="button button4" href="https://www.agernic.com">
Agernic tutorial</a>
<a class="button button5" href="https://www.agernic.com">
Agernic tutorial</a>
</p>
</body>
</html>

 



link example, gradient, shadow, generator bootstrap
CSS rounded corners button - css tutorial

Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


CSS Scrollbar Horizontal
CSS Scrollbar in Div
CSS Scrollbar Firefox
CSS Style Scrollbar
CSS Style Text
CSS background color
CSS Div Id Class
CSS Text Wrap
CSS text-align
CSS Text Decoration
CSS Text Shadow
CSS Text Color
CSS Text Bold
CSS Text Size
CSS background image full
CSS background opacity
CSS border radius
CSS rounded corners
CSS font color
CSS Class & ID
CSS align image center
CSS align content
CSS link color
CSS Text Style
CSS Text Font Size
CSS max width &height
CSS width and height
CSS Margin
CSS Padding
CSS Border Style
CSS background
CSS in HTML
Basic Syntax of CSS
CSS Introduction
Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


jQuery replace...
jQuery replaceClass...
jQuery click ()...
jQuery switchClass()...
jQuery draggable()...
jQuery HTML...
jQuery scroll smooth...
jQuery scroll()...
jQuery stop()...
jQuery animate()...
jQuery SlideToggle()...
jQuery slideDown()...
jQuery slideUp()...
jQuery fadeToggle...
jQuery fadeOut()...
jQuery fadeIn()...
jQuery Effects - hide () and show ()...
jQuery Events...
jQuery Attributes...
jQuery Selectors...