How can I tag it?

I have a photo and it looks like this: enter image description here

And I want to mention its HTML and CSS.

I want the curved part to always be in the center of the screen and have content. And I want the flat parts to stretch depending on the width of the user's screen on the sides.

How can i do this? Can someone provide me with examples?

Thank you for the attention.

+4
source share
1 answer

You can try with this demo

HTML

#test{
    width: 50px;
    height: 600px;
    background: green;
    position: absolute;
    top:0;
    left:0;
    right:0;
    margin: auto;
    display: inline-block;
    -webkit-transform: translate(300px) rotate(90deg) ;
    -webkit-transform-origin: left top;
}

#test:after{
    background: white;
    height: 600px;
    width: 100px;
    border-radius: 100px 0 0 100px / 600px 0 0  600px;
    display: inline-block;
    content: '';
    position: relative;
    left: 25px;
}

So, here is the final demo as needed

HTML

<div id="testbefore"></div>
<div id="test"></div>

CSS

body, html {
    margin:0;
    padding:0;
    width:100%;
}
#testbefore {
    width: 100%;
    height: 50px;
    background: green;
}
#test {
    width: 50px;
    height: 600px;
    background: green;
    position: absolute;
    top:0;
    left:0;
    right:0;
    margin: auto;
    display: inline-block;
    -webkit-transform: translate(300px) rotate(90deg);
    -webkit-transform-origin:top;
}
#test:after {
    background: white;
    height: 600px;
    width: 100px;
    border-radius: 100px 0 0 100px / 600px 0 0 600px;
    display: inline-block;
    content:'';
    position: relative;
    left: 50px;
}
+2
source

All Articles