0

shape-css?

How to create a circle background and crop it in div?

2 Answers 2

2

a simple clip-path can do it:

.box {
  width:300px;
  height:150px;
  background:lightblue;
  clip-path:circle(farthest-side);
}
<div class="box"></div>

Or a radial-gradient

.box {
  width:300px;
  height:150px;
  background:radial-gradient(circle farthest-side,lightblue 98%,#0000);
}
<div class="box"></div>

Sign up to request clarification or add additional context in comments.

Comments

0

.container {
    width: 320px;
    height: 160px;
    overflow:hidden;
}
.circle {
    background-color: #aad2dd;
    border-radius: 50%; 
    width: 320px;
    height: 320px;
    margin-top: -80px;
}
<div class="container">
    <div class="circle"></div>
</div>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.