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

CSS rounded corners


In this article we will see how we can get rounded corner effect using border radius without going through the laborious process of creating images and fitting them in every item corner to create the desired effect.
We will instead use something that designers and developers have already begun to adopt with great joy in CSS.

CSS rounded corners - how to create - example


With CSS, you can give each element "rounded corners" using proprietary radius borders.

Here are three examples:
1. rounded corners for an item with a specified background color,
2. rounded corners for an element with a border,
3. rounded corners for an element with a background image.
Here is the code:

Example 1:

.corner-radius1
{
border-radius:12px;
padding:10px;
width:250px;
height:160px;
background-color: #FF9;
float: left;
}

.corner-radius2
{
border-radius:12px;
padding:10px;
width:250px;
height:160px;
border: thin solid #0C0;
float: left;
margin-left: 18px;
}

.corner-radius3
{
border-radius:12px;
padding:10px;
width:250px;
height:160px;
background-image: url(https://www.agernic.com/uploads/paper.gif);
float: left;
margin-left: 18px;
}

HTML cod above will display this result -

css border radius

Note: border-radius property is actually an abbreviation for border-top-left-radius, border-top-right-radius, border-bottom-right-radius and border-bottom-left-radius properties.

CSS border-radius - Specify each corner - How to create

If you specify a single border property radius value, this radius will be applied to all four corners.
However, you can specify each corner separately if you want. Here are the rules:

Four values: the first value is valid for the top left, the second value is applied from the top right, the third value is applied to the bottom right, and the fourth value is applied in the lower-left corner
Three values: the first value is valid for the top left, the second value is for the top-right and the lower-left, and the third value is applied to the bottom-right
There are two values: the first value is applied to the top left and right-hand corner, and the second value is applied from the top right and the lower-left corner
A single value: all four corners are rounded evenly
Here are three examples:
1. Four values ​​- border-radius:15px 50px 30px 5px:
2. three values ​​- border-radius:15px 50px 30px:
3. There are two values ​​- border-radius:15px 50px:

Example 2:
.corner-radius4 {
border-radius: 15px 50px 30px 5px;
padding:10px;
width:250px;
height:160px;
border: thin solid #0C0;
float: left;
margin-left: 18px;
}

.corner-radius5 {
border-radius: 15px 50px 30px;
background:#73AD21;
padding:10px;
width:250px;
height:160px;
border: thin solid #0C0;
float: left;
margin-left: 18px;
}

.corner-radius6 {
border-radius:15px 50px;
padding:10px;
width:250px;
height:160px;
border: thin solid #0C0;
float: left;
margin-left: 18px; 
}
The HTML cod above will display this result -


css border radius, css border radius without images
CSS rounded corners - 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.


PHP convert array to string with commas...
PHP array to comma separated string with...
How to put text in image HTML...
How to insert text in html code using ja...
PHP array_key_exists() Function...
Bootstrap Templates...
Bootstrap Text...
Bootstrap Accordion...
Bootstrap Scrollspy...
Bootstrap Carousel...
Bootstrap Modal...
Bootstrap Responsive Layout...
Bootstrap Fluid Layout...
Bootstrap Fixed Layout...
Bootstrap Grid...
Bootstrap Input...
Bootstrap Icon...
Bootstrap Dropdown...
Bootstrap Navigation Bar...
Bootstrap Pagination...