3

I want to create a shape like this:

enter image description here

It should fit into the screen and it should be cut on the left hand side.

How can i do this?

What i have now is this:

    .shape {
      height: 92vw;
      width: 100vw;
      background-color: red;
      position: absolute;
      bottom: 0px;
      border-radius: 92vw 0px 0px 0px;
    }
<div class="shape"></div>

7
  • Why not make an SVG? Commented Jul 14, 2016 at 8:06
  • is it possible to style svg's with css? Commented Jul 14, 2016 at 8:07
  • Depends what you want to do, you can change colours etc inline Commented Jul 14, 2016 at 8:07
  • @olivier Yes, SVG can be styled with CSS as any other XML or HTML document. Commented Jul 14, 2016 at 8:10
  • Thanks a lot Andy and feeela i was already able to do it. =) Commented Jul 14, 2016 at 8:13

2 Answers 2

2

You can use a pseudo element

html, body {
  margin: 0;
}
.shape {
  height: 100vh;
  width: 100vw;
  position: relative;
  overflow: hidden;
}
.shape:before {
  content: '';
  height: 250vh;
  width: 250vw;
  background-color: #ecdbb0;
  position: absolute;
  top: 20px;
  left: -20vw;
  border-radius: 50%;
}
<div class="shape"></div>

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

Comments

2

I solved it with a SVG.

Thanks andy and feeela!

html, body {
  margin: 0;
}
#shape {
  position: absolute;
  bottom: 0px;
}
<svg id="shape" data-name="Form crop" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 928.08"><defs><style>.cls-1{fill:#ecdbb0;opacity:0.6;}</style></defs><title>shape</title><path class="cls-1" d="M2379.69,1551.29V623.21c-603.05,53.25-876.26,317.23-999.59,558.26l-0.41.8v369h1000Z" transform="translate(-1379.69 -623.21)"/></svg>

3 Comments

No problem :) Glad to be of help :)
In this example it doesn't work. Answer provided for LGSon is better I guess.
You can make it work with your SVG on all platforms, though with my suggested solution you get easier maintenance and full control of all part of the shape using standard CSS ... and no extra markup :)

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.