Reputation: 3163
I am trying to create a shape like attached below using css in full width screen, but not able to achieve, Here is the example image
This is what I have tried so far (but wanted to make it responsive)
body
{
background:#090d15;
}
.arrow-shape{
width: 0;
height: 0;
border-style: solid;
border-width: 55px 190px 0 190px;
border-color: #082947 transparent transparent transparent;
}
<div class="arrow-shape"></div>
Upvotes: 0
Views: 2142
Reputation: 7692
* {
padding: 0;
margin: 0;
}
.container {
width: 100%;
}
<div class="container">
<svg width="100%"
viewBox="0 0 60 50" height="50px" preserveAspectRatio="none">
<polyline points="0,0 0,10 30,50 60,10 60,0"
stroke-width="0" fill="orange"/>
</svg>
</div>
Upvotes: 1
Reputation: 87191
If you combine viewport units and px
, it will scale to full width and have its height kept at 55px
body
{
margin: 0;
background:#090d15;
}
.arrow-shape{
width: 0;
height: 0;
border-style: solid;
border-width: 55px 50vw 0 50vw;
border-color: #082947 transparent transparent transparent;
}
<div class="arrow-shape"></div>
Upvotes: 1
Reputation:
For a full-page, you can use the ``vhand
vw` properties for your border.
100vw means 100% of the viewport width. I'll let you guess for vh !
Upvotes: 0
Reputation: 1586
You can try it with vw and vh if it can be fullscreen.
.arrow-shape{
width: 0;
height: 0;
border-style: solid;
border-width: 20vh 50vw 0 50vw;
border-color: #082947 transparent transparent transparent;
}
<div class="arrow-shape"></div>
Upvotes: 2