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

How to set border rounded corners in html

Dec 14, 2021 pm 02:37 PM
html

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>

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>

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!

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

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1511
276
What is the purpose of the rel attribute in a link tag in HTML? What is the purpose of the rel attribute in a link tag in HTML? Aug 03, 2025 pm 04:50 PM

rel="stylesheet"linksCSSfilesforstylingthepage;2.rel="preload"hintstopreloadcriticalresourcesforperformance;3.rel="icon"setsthewebsite’sfavicon;4.rel="alternate"providesalternateversionslikeRSSorprint;5.rel=&qu

How to use HTML to create a link that opens in a new tab How to use HTML to create a link that opens in a new tab Aug 05, 2025 am 04:29 AM

To safely open a link in a new tab, you need to use target="_blank" and always cooperate with rel="noopener". You can choose rel="noreferrer" to enhance privacy protection. The specific steps are: 1. Use href to set the target URL; 2. Add target="_blank" to open the link in a new tab; 3. Add rel="noopener" to prevent the new page from manipulating the original page and improving performance; 4. You can choose rel="noreferrer" to prevent sending

How to highlight text with the  tag? How to highlight text with the tag? Aug 04, 2025 pm 04:29 PM

Use tags to highlight text semantically, often used to identify search results or important content; 2. Custom styles such as background colors, text colors and borders can be customized through CSS; 3. It should be used in contexts with practical significance, rather than just visual decoration to improve accessibility and SEO effects.

How to add an icon to your website title tab in HTML How to add an icon to your website title tab in HTML Aug 07, 2025 pm 11:30 PM

To add an icon to the website title bar, you need to link a favicon file in part of the HTML. The specific steps are as follows: 1. Prepare a 16x16 or 32x32 pixel icon file. It is recommended to use favicon.ico to name it and place it in the website root directory, or use modern formats such as PNG and SVG; 2. Add link tags to HTML, such as PNG or SVG formats, adjust the type attribute accordingly; 3. Optionally add high-resolution icons for mobile devices, such as AppleTouchIcon, and specify different sizes through the sizes attribute; 4. Follow best practices, place the icon in the root directory to ensure automatic detection, clear the browser cache after update, and check the correctness of the file path.

How to use the HTML abbr tag for abbreviations How to use the HTML abbr tag for abbreviations Aug 05, 2025 pm 12:54 PM

Using HTML tags can improve the accessibility and clarity of content; 1. Mark abbreviations or acronyms with abbreviations; 2. Add title attributes to unusual abbreviations to provide a complete explanation; 3. Use when the document first appears, avoiding duplicate annotations; 4. You can customize the style through CSS, and the default browser usually displays dotted underscores; 5. It helps screen reader users understand terms and enhance user experience.

How to use HTML for basic text formatting How to use HTML for basic text formatting Aug 05, 2025 pm 03:05 PM

Useforboldandsemanticimportance,andforitalicandemphasisinsteadoforforbetteraccessibilityandSEO.2.Structurecontentwithheadingtagsto,anduseforsmallertextlikedisclaimers.3.Separateparagraphswithandinsertlinebreakswithinparagraphsusingtheself-closingtag.

What is the difference between HTML id and class What is the difference between HTML id and class Aug 07, 2025 am 12:03 AM

The id must be unique. One id in each page can only be used for one element, and the class can be reused on multiple elements, and one element can have multiple classes; 2. Scenarios using id include: positioning a single specific element, link anchors within the page, JavaScript operates elements through id, and labels associated with form elements; scenarios using class include: applying the same style or behavior to multiple elements, building reusable UI components, and selecting multiple elements in JavaScript; 3. In CSS, targeting is done by #id selector and .class selector respectively, getElementById() is used for id, getEleme

How to embed a Google Map into an HTML webpage How to embed a Google Map into an HTML webpage Aug 05, 2025 pm 02:49 PM

Find the map location and adjust the view; 2. Click "Share or Embed" to get the iframe code; 3. Paste the code into HTML; 4. Optionally adjust the size and responsive layout through CSS. Embedding Google Maps does not require an API key, you just copy the provided iframe code and insert the web page, ensuring that the map is publicly accessible and not scaled to too small, ultimately enabling fast and free map embedding, suitable for any standard website.

See all articles