Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to put texts in svg waves

I’m tryn put some texts inside my wave from getwaves.io but the texts appear below the wave. I’ve taken a look at a blog which used these code but they do not work to me.

html
<div class="wave-container">
  <h1>Hello, world!</h1>
  <p>Check out my awesome waves!</p>
     <svg>the svg wave</svg>
    </div>

my css

html {
  box-sizing: border-box;
}

body {
  margin: 0;
}
.wave-container {
  background: #EEE;
}
.wave-container > svg {
  display: block;

body {
  margin: 0;
  font-family: system-ui, sans-serif;
}
.wave-container {
  position: relative;
  background: #09F;
  color: #FFF;
  text-align: center;
  overflow: hidden;
}
h1 {
  font-size: 5rem;
  margin: 7rem 1.25rem 2.5rem 1.25rem;
}
p {
  font-size: 1.5rem;
  margin: 0 1.25rem 5rem 1.25rem;
}
}

Can someone help please

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

If you just want the text above the svg wave, what you can do is:

HTML:

<div class="wave-container">
  <div class="text-container">
    <h1>Hello, world!</h1>
    <p>Check out my awesome waves!</p>
  </div>
  <svg>the svg wave</svg>
</div>

CSS:

.wave-container{
    position: relative;
}
.text-container{
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

Just try this, hope this will help 😉

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading