Articles → CSS → Border-Radius Property In CSS3

Border-Radius Property In CSS3






Purpose





Syntax


  <element style=" border-radius:value_in_pixel;" />



Specify A Corner Of The Element




  1. Top left corner
  2. Top right corner
  3. Bottom right corner
  4. Bottom left corner


Picture showing all the corners of an element
Click to Enlarge


Rules Of Specifying Corner




  1. Four values
    1. first value applies to the top left corner
    2. second value applies to the top right corner
    3. third value applies to the bottom right corner
    4. fourth value applies to the bottom left corner.
  2. Three values
    1. first value applies to the top left corner
    2. second value applies to the top right and bottom left corner
    3. third value applies to the bottom right corner.
  3. Two values
    1. first value applies to the top left and bottom right corner
    2. second value applies to the top right and bottom left corner.
  4. One value – Applies to all 4 corners.

Example


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

<head>
	<meta charset="utf-8" />
	<title></title>
</head>

<body>
	<form>
		<div style="border: 2px solid red; width:100px;height:100px;  border-radius:30px;" />
		<!--one value-->
		<br />
		<br />
		<br />
		<br />
		<br />
		<br />
		<br />
		<br />
		<div style="border: 2px solid red; width:100px;height:100px;  border-radius:30px  20px;" />
		<!--two values-->
		<br />
		<br />
		<br />
		<br />
		<br />
		<br />
		<br />
		<br />
		<div style="border: 2px solid red; width:100px;height:100px;  border-radius:30px  20px 40px;" />
		<!--three values-->
		<br />
		<br />
		<br />
		<br />
		<br />
		<br />
		<br />
		<br />
		<div style="border: 2px solid red; width:100px;height:100px;  border-radius:30px  20px 40px 50px;" />
		<!--four values-->
	</form>
</body>

</html>



Output


Picture showing the output of border-radius property in CSS3
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Friday, January 27, 2017

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250