Custom border in css

I am trying to make a custom border in style. I need the box to be like in first pic. I tried tweaking border radius but its not matching as per design, can someone help me with it. codesandbox link: https://codesandbox.io/p/sandbox/xzzh99 Here's the code i tried
<div
style={{
height: "100vh",
background: "#7047EE",
display: "flex",
justifyContent: "center",
}}
>
<div
style={{
background: "#fff",
height: "30px",
display: "grid",
placeItems: "center",
padding: "0px 10px",
borderRadius: "0px 0px 10px 10px",
}}
>
<div style={{ fontWeight: "bold" }}>IN 2HR </div>
</div>
</div>
<div
style={{
height: "100vh",
background: "#7047EE",
display: "flex",
justifyContent: "center",
}}
>
<div
style={{
background: "#fff",
height: "30px",
display: "grid",
placeItems: "center",
padding: "0px 10px",
borderRadius: "0px 0px 10px 10px",
}}
>
<div style={{ fontWeight: "bold" }}>IN 2HR </div>
</div>
</div>
No description
No description
6 Replies
Mannix
Mannixβ€’3w ago
use normal version for each border radius (not the shorthand) radius corner it can accept two values e.g border-bottom-left-radius: 30px 40px
smackalpha
smackalphaOPβ€’3w ago
but its not matching as like in design
No description
Mannix
Mannixβ€’3w ago
then you would have to go with clip-path or mask-image
smackalpha
smackalphaOPβ€’3w ago
Ok.. I will try that way.
smackalpha
smackalphaOPβ€’3w ago
@Chooβ™šπ•‚π•šπ•Ÿπ•˜ thanks a lot

Did you find this page helpful?