0

Is any ways to make this figure with only html & css?

enter image description here

0

2 Answers 2

6

Almost the same solution as @pedram, but using pseudo element in order to avoid inverse skewing the content inside the div (if there will be a content) :

div.content {
    width: 200px;
    height: 200px;
    position:relative;
    padding:20px;
    box-sizing:border-box;
}
div.content:before { 
    content:"";
    position:absolute;
    background: #ff8f00;
    border-radius: 15px;
    transform: skew(-5deg);
    top:0;
    left:0;
    right:0;
    bottom:0;
    z-index:-1;
]
<div class="content">
lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume lorem ipsume
</div>

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

Comments

3

You should use transform skew like below, and your shape called Parallelogram

div {
    width: 200px;
    height: 200px;
    background: #ff8f00;
    border-radius: 15px;
    transform: skew(-5deg); /* OR transform: skew(-190deg); */
    position: relative;
    left: 20px;
    top: 10px;
}
<div>
</div>

1 Comment

@bhansa This works too, not -20 but transform: skew(-10deg); works.

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.