Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wave background on top and bottom of a section

I have a section FAQ, which I would like a top section to have top wave background and bottom section also to have a wave background

I would like to have something like this enter image description here

Here is what I have so far

HTML

<section id="faq">
  <div id="details">
  </div>
</section>

css

#faq{
  background-image: url("wave-top.svg")
  background-repeat: no-repeat, repeat;
  background-color: blue;
}

Here is two images I have for background

Top wave enter image description here

Bottom wave

enter image description here

What do I need to do to get what I want?

like image 513
The Dead Man Avatar asked Oct 29 '25 05:10

The Dead Man


1 Answers

Use multiple background and adjust the background-size/background-position:

.box {
  padding:11% 0; /* The padding is the area for the shapes, adjust it based on the ratio of the shape*/
  height:100px; /* to illustrate the space for the content */
  background:
    url(https://i.sstatic.net/mG3Vb.png) top   /100% auto,
    url(https://i.sstatic.net/JSEyE.png) bottom/100% auto,
    linear-gradient(#387dff,#387dff) content-box; /* Color between the shapes only on the content and not the padding*/
  background-repeat:no-repeat;
}
<div class="box">
</div>
like image 159
Temani Afif Avatar answered Oct 31 '25 19:10

Temani Afif