I want to create a div with this shape using html css: shaped div I created something like below but its border not look like the photo above. Can someone help me?
<!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>
</head>
<style>
.card{
background-color: rgb(237, 241, 244);
position: relative;
border-radius: 12px;
width: 300px;
height: 450px;
}
.header{
position: absolute;
top: 0;
left: 0;
right: 0;
margin-left: auto;
margin-right: 38px;
border-radius: 8px;
height: 20px;
width: 100px;
background-color: white;
}
</style>
<body>
<div class="card">
<div class="header"></div>
</div>
</body>
</html>
2
Answers
You can get the desired effect with additional rounded divs left and right of the tab title and by selectively rounding corners:
border-radius: 0px 0px 8px 8px;