This is a div that stretches the whole mobile screen; I'd want it to have a tilted curve(as shown in image) from top-right to top-left. I tried border-radius but that didn't work as expected.
Is there a way to do this using CSS?
This is a div that stretches the whole mobile screen; I'd want it to have a tilted curve(as shown in image) from top-right to top-left. I tried border-radius but that didn't work as expected.
Is there a way to do this using CSS?
Perhaps clip-path property might work for you.....
.container {
background: #f6eee0;
clip-path: polygon(0 10%, 100% -2%, 100% 100%, 0 100%);
height: 80vh;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="container"></div>
</body>
</html>
Here is the updated snippet including the curve, if you need to increase/decrease the size of the curve just play around with the negative value in the clip-path property until you find the sweet spot and suits you the best...