Place h2 and button on CSS image

0

I'm developing a web application and I would like to put the title <h2> and a button on an image but by placing the title and the button the image desalinha going down.

Link to my application

    
asked by anonymous 26.01.2018 / 01:40

1 answer

0

Create a class and place the text and the button inside it to separate them from the image:

<span class="bot_comprar">
   <h2>Bolos até R$30,00</h2>
   <button type="button" class="comprar_botao">Comprar</button>
</span>

In CSS, add:

*{
   position: relative;
}

.bot_comprar{
   position: absolute;
   top: 0;
   left: 0;
   z-index: 9;
}
    
26.01.2018 / 01:59