Home > Article > Web Front-end > Create rounded images and oval images with CSS3
This article mainly teaches you the specific implementation code for making rounded images and elliptical images using CSS3. It has a certain reference value. Interested friends can refer to it.
The examples in this article are shared with you. The method of making rounded and oval images with CSS3 is for your reference. The specific content is as follows
1. Rounded images
XML/HTML CodeCopy content to clipboard
<!DOCTYPE html> <html> <head> <style> img { border-radius: 8px; } </style> </head> <body> <h2>圆角图片</h2> <p>使用 border-radius 属性来创建圆角图片:</p> <img src="paris.jpg" alt="Paris" width="400" height="300"> </body> </html>
##2. Oval image
##XML/ HTML CodeCopy content to clipboard<!DOCTYPE html>
<html>
<head>
<style>
img {
border-radius: 50%;
}
</style>
</head>
<body>
<h2>椭圆形图片</h2>
<p>使用 border-radius 属性来创建椭圆形图片:</p>
<img src="paris.jpg" alt="Paris" width="400" height="300">
</body>
</html>
##Related recommendations:
Use pure CSS Example of realizing dynamic text effects
CSS text font color setting method (CSS color)
The above is the detailed content of Create rounded images and oval images with CSS3. For more information, please follow other related articles on the PHP Chinese website!