-4

I want to ask a way to create a repetitive wave on the bottom of the div using css, here's an example of his image enter image description here

  • 2
    Possible duplicate of [Wave border in CSS](https://stackoverflow.com/questions/33759102/wave-border-in-css) – CBroe Aug 15 '17 at 12:19
  • 1
    Plus https://www.google.com/search?q=css+wave+pattern if you need more possible approaches. – CBroe Aug 15 '17 at 12:20

1 Answers1

0

html, body { height: 100%; }
body {
  background:radial-gradient(ellipse at center, rgba(255,254,234,1) 0%, rgba(255,254,234,1) 35%, #B7E8EB 100%);
  // background:#B7E8EB;
  overflow: hidden;
}

.ocean { 
  height: 5%;
  width:100%;
  position:absolute;
  bottom:0;
  left:0;
  background: #015871;
}

.wave {
  background: url(http://tedmcdo.com/labs/wave.svg) repeat-x; 
  position: absolute;
  top: -198px;
  width: 6400px;
  height: 198px;
  animation: wave 7s cubic-bezier( 0.36, 0.45, 0.63, 0.53) infinite;
  transform: translate3d(0, 0, 0);
}

.wave:nth-of-type(2) {
  top: -175px;
  animation: wave 7s cubic-bezier( 0.36, 0.45, 0.63, 0.53) -.125s infinite, swell 7s ease -1.25s infinite;
  opacity: 1;
}

@keyframes wave {
  0% {
    margin-left: 0;
  }
  100% {
    margin-left: -1600px;
  }
}

@keyframes swell {
  0%, 100% {
    transform: translate3d(0,-25px,0);
  }
  50% {
    transform: translate3d(0,5px,0);
  }
}
<div class="ocean">
  <div class="wave"></div>
</div>
Hassan
  • 86
  • 2
  • 10