CSS rounded corners
CSS Tutorial » CSS rounded corners
CSS 3 incorporates new properties for controlling the edges of the elements.
Edges with rounded corners, image borders (even multiple images can be used to define the appearance of the border), shadows, etc. are now allowed.
We have the border-radius property, which allows defining rounded edges at the corners, specifying the radius measurements to be given to the corner curve.
Syntax:
This green element has a width of 300px, a height of 150px, red border border-radius: 20px, solid, yellow marjen 10px, and centered in the center.
CSS rounded corners div
Un selector de ID es un identificador único del elemento HTML al que se debe aplicar un estilo en particular. Se usa solo cuando un solo elemento HTML en la página web debe tener un estilo específico.
Tanto en las hojas de estilo internas como en las externas, usamos hash (#) para un selector de id.
<!DOCTYPE html>
<html>
<head>
<style>
#corner1 {
border-radius: 25px;
padding: 20px;
width: 200px;
height: 150px;
background-color: #C6EB94;
}
#corner2 {
border-radius: 25px;
border: 2px solid #73AD21;
padding: 20px;
width: 200px;
height: 150px;
}
.corner3 {
border-radius: 25px;
background: url(https://www.agernic.com/uploads/paper.gif);
background-position: left top;
background-repeat: repeat;
padding: 20px;
width: 200px;
height: 150px;
}
</style>
</head>
<body>
<h1>The border-radius property</h1>
<p>Rounded corners for an element with a specific background color:</p>
<p id="corner1">Rounded corners! for paragraph<br />
<strong>border-radius: 25px; </strong></p>
<p>Rounded corners for an element with a border:</p>
<div id="corner2">Rounded corners!<br />
<strong>border-radius: 25px;<br />
div id
</strong></div>
<p>Rounded corners for an element with a background image:</p>
<div class="corner3">Rounded corners!<br />
<strong>border-radius: 25px;<br />
div class background image
</strong></div>
</body>
</html>
Tags: css esquinas redondeadas, redondas, redondear esquina imagen, css dorder esqinas redondeadas, div esquinas redondeadas, cuadros con esquina redondeadas, esquinas rectas, html css tablas esquinas redondeadas, css3
Creating CSS rounded corners image
The border-image property allows you to specify an image to act as an element's border.
In the case that we want to place rounded or round edges in an image or several images we can apply everything seen above, only that this time the CSS would be directed to the image:
<!DOCTYPE html>
<html>
<head>
<style>
#corner_img1 {
background: url(https://www.agernic.com/uploads/paper.gif);
border-radius: 50px;
height: 200px;
width: 200px;
}
#corner_img2 {
background: url(https://www.agernic.com/uploads/paper.gif);
width:250px;
height:250px;
border-radius:50%;
overflow:hidden;
}
.corner_img3 {
border-radius: 25px;
background: url(https://www.agernic.com/uploads/paper.gif);
background-position: left top;
background-repeat: repeat;
padding: 20px;
width: 200px;
height: 150px;
}
</style>
</head>
<body>
<h1>The border-radius property</h1>
<p>Rounded corners for an element with a specific background color:</p>
<p id="corner_img1">Rounded corners! for paragraph<br />
<strong>border-radius: 25px; </strong></p>
<p>Rounded corners for an element with a border:</p>
<div id="corner_img2">Rounded corners!<br />
by adding a parent div to your img and the code flows as follows
</strong></div>
<p>Rounded corners for an element with a background image:</p>
<div class="corner_img3">Rounded corners!<br />
<strong>border-radius: 25px;<br />
div class background image
</strong></div>
</body>
</html>
How to create a Button with CSS Rounded Corners
Make a CSS Button with Rounded Corners
Every button you click on the web, they are all created with HTML and Designed by CSS. CSS allows designing your own customized button as you need. In this tutorial, we will create a customized CSS button with Rounded Corner.
<!DOCTYPE html>
<html>
<head>
<style>
button.mbtn {
padding:0.6em 2em;
border-radius: 8px;
color:#fff;
background-color:#1976d2;
font-size:1.1em;
border:0;
cursor:pointer;
margin:1em;
}button.mbtn.green
{
background-color:#2e7d32;
}button.mbtn.red
{
background-color:#c62828;
}
</style>
</head>
<body>
<h1>The button border-radius property</h1>
<button class="mbtn blue">Button</button><button class="mbtn green">Proceed</button>
<button class="mbtn red">Delete</button>
</body>
</html>
Etiquetas: css rounded corners, image, div, button, table, top only, on one side, bottom only, percentage
CSS rounded corners - css tutorial
This tool makes it easy to create, adjust, and experiment with custom colors for the web.

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

Find here examples of creative and unique website layouts.

Find here examples of creative and unique website CSS HTML menu.