How to create uneven rounded sides on a div?
You can consider clip-path
.box {
height: 200px;
width: 200px;
background: blue;
clip-path: circle(75% at 65% 10%);
}
<div class="box">
</div>
How do I re-create this shape in html & css?
Here I have created a transparent background circle and inner colored div with absolute position, so inner div gets cropped(overflow:hidden) by the outer circle.
You can always adjust the dimensions to get the different shapes around.
drop-shadow filter function creates a shadow that conforms to the shape (alpha channel) of the image itself
.outer {
width: 10rem;
height: 10rem;
background: transparent;
border-radius: 50%;
position: relative;
overflow: hidden;
filter: drop-shadow(2px 0 2px #444);
}
.inner {
width: 5rem;
height: 5rem;
background: #b63689;
position: absolute;
top: 50%;
right:0;
transform: translateY(-50%);
border-radius: 5px;
}
<div class="outer">
<div class="inner">
</div>
</div>
CSS: Rounded effect
Just change px
for %
: border-radius: 0px 0px 50% 500%;
:
body {
height: 100vh;
width: 100%;
}
#oval {
position: relative;
width: 100%;
height: 100px;
background: #ffffff;
border-radius: 0px 0px 50% 500%;
}
<div style="width: 100%; height: 100px; background-color: #30393b">
<div id="oval" />
</div>
<div style="width: 100%; height: 100px; background-color: #30393b" />
How to shape a div corner in css
You can hack using multiple elements like this:
.d1 { width: 100px; height: 100px; background-color: #00f;}
.wrapper { width: 100px; height: 20px; background-color: #fff; margin-top: -20px;}
.d2 { width: 100%; height: 100%; border-radius: 50%; background-color: #00f;}
.wrapper2 { width: 100px; height: 10px; background-color: #00f; margin-top: -20px; position: absolute;}
<div class="d1"></div><div class="wrapper"> <div class="d2"></div></div><div class="wrapper2"></div>
How to obtain a slanted-curve for my div? Like one shown below
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>
Having problem making image a certain shape with css
You can use css clipping masks to cut the image into shape.
clip-path: circle(60% at 30% 30%);
If you need help creating the mask, use clippy.
Related Topics
Several Elements With the Same Id Responding to One CSS Id Selector
Some Emmet Abbreviations in Vsc Not Working, Like '!' or Using '*'
Using Sections in Editor/Display Templates
Inline-Block Boxes Not Fitting in Their Container
Limit Scope of External CSS to Only a Specific Element
What Does "For" Attribute Do in HTML ≪Label≫ Tag
How to Make a Pure CSS Based Dropdown Menu
Html Table Headers Always Visible At Top of Window When Viewing a Large Table
Preventing Double Borders in CSS Grid
Equal Height Children of Flex Items
Make CSS Hover State Remain After "Unhovering"
Show an Image Preview Before Upload
Using Margin:Auto to Vertically-Align a Div
Why Do Absolute Elements Stack Up on Each Other Instead of Stacking One After the Other