CSS - ClipPath
Aus Wikizone
Version vom 29. November 2024, 07:41 Uhr von 109.193.152.88 (Diskussion) (Die Seite wurde neu angelegt: „== Links == https://developer.mozilla.org/en-US/docs/Web/CSS/clip-path == Beispiele == <syntaxhighlight lang="html5"> <!DOCTYPE html> <html lang="en"> <head…“)
Links
https://developer.mozilla.org/en-US/docs/Web/CSS/clip-path
Beispiele
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Clipped Image</title>
<style>
.clipped-container {
margin: 2em auto;
position: relative;
width: 100%;
max-width: 800px;
aspect-ratio: 1200 / 800;
clip-path: polygon(0 0, 100% 0, 100% 85%, 58% 92%, 51% 100%, 43% 94%, 0 100%);
overflow: hidden;
}
.clipped-container img {
width: 100%;
height: 100%;
object-fit: cover;
}
</style>
</head>
<body>
<div class="clipped-container">
<img src="image.jpg" alt="Clipped Image">
</div>
</body>
</html>