Home > Web Front-end > CSS Tutorial > How to achieve fan-shaped presentation of pictures in css3

How to achieve fan-shaped presentation of pictures in css3

WBOY
Release: 2021-12-16 17:13:43
Original
2563 people have browsed it

Method: 1. Use the "border-radius" attribute to set the square element into a fan shape. The syntax is "border-radius: square width value 0 0;"; 2. Use the "element {background-image:url (Picture path);}" statement can set the background image for the fan-shaped element.

How to achieve fan-shaped presentation of pictures in css3

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

How to realize fan-shaped display of pictures in css3

In css, you can use the border-radius attribute and background-image attribute to realize fan-shaped display of pictures.

The border-radius attribute can set a square element to a fan shape, and then use the background-image element to set a background image for the fan-shaped element.

The example is as follows:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
  div{
 border-radius:200px 0 0;
  width: 200px;
  height: 200px;
  background-image:url(1118.02.png);
}
  </style>
</head>
<body>
  <div></div>
</body>
</html>
Copy after login

Output result:

How to achieve fan-shaped presentation of pictures in css3

(Learning video sharing: css video tutorial)

The above is the detailed content of How to achieve fan-shaped presentation of pictures in css3. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
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