Home > Web Front-end > HTML Tutorial > How to set border rounded corners in html

How to set border rounded corners in html

青灯夜游
Release: 2021-12-14 14:37:29
Original
49551 people have browsed it

Setting method: 1. Use the border-radius attribute, the syntax "border-radius: fillet radius;"; 2. Use the border-image attribute to create a border with a picture with rounded corners, the syntax " border-image:url(rounded image address) 20 fill;”.

How to set border rounded corners in html

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

htmlSet border rounded corners

1. Use the border-radius attribute

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<style>
			div {
				border: 2px solid #a1a1a1;
				padding: 10px 40px;
				background: #dddddd;
				width: 300px;
				border-radius: 25px;
			}
		</style>
	</head>
	<body>

		<div>border-radius 属性为元素添加圆角边框! </div>
	</body>
</html>
Copy after login

How to set border rounded corners in html

2. Use the border-image attribute

Use an image with rounded corners to create a border

Example:

Use pictures: How to set border rounded corners in html

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<style>
			.border_image{
			    width:100px;
			    border:double gray 10px;
			    border-image:url(https://img.php.cn/upload/article/000/000/024/61b839d3982fc635.png) 20 fill;
			    text-align:center; 
			    color:white;
			}
		</style>
	</head>
	<body>
		<div class="border_image">1</div>
	</body>
</html>
Copy after login

How to set border rounded corners in html

Recommended tutorial: "html video tutorial"

The above is the detailed content of How to set border rounded corners in html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template