r/CodingHelp • • Oct 21 '19

[CSS] How to draw this pattern in css?

Post image
15 Upvotes

4 comments sorted by

3

u/MrQuickLine CSSophile Oct 21 '19

I agree! SVG is the better answer. But here it is in pure CSS. I tried to use varied and interesting methods to get it done. e.g. - I could have used borders on the middle box, but I knew I was going to use it on the right box instead.

https://codepen.io/anonymousjoe/pen/wvvggQQ

You can edit that one CSS Custom Property at the top: --height: 5rem; to be anything you want so the whole thing grows and shrinks.

1

u/tolojo Oct 22 '19

You're very nice

1

u/MrQuickLine CSSophile Oct 22 '19

Thanks friend!

2

u/[deleted] Oct 21 '19

SVG is a better option but I would look up CSS drawing tutorials if you want to do it in CSS.