Inserire titolo e pulsante su immagine



Titolo sito
foto4


Codice HTML

<div class="container">
<div class=titolo> Titolo sito</div>
 <img src="https://www.puntoinformaticofree.it/guida_css/resources/foto/foto4.jpg" alt="foto4">
 <form method="get" action="URL_PAGINA_WEB"><button class="btn">Pulsante</button></form></div>


Codice CSS

/* Container needed to position the button. Adjust the width as needed */
.container {
 position: relative;
 width: 50%;
 min-width: 400px; }

/* Make the image responsive */ .container img { width: 100%; min-height: 300px;
max-height: 400px; }

/* Style the button and place it in the middle of the container/image */ .container .btn { position: absolute; top: 80%; left: 50%; transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); background-color: #555; color: white; font-size: 16px; padding: 12px 24px; border: none; cursor: pointer; border-radius: 5px; }

.container .btn:hover { background-color: black; }

.titolo { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); text-align: center; color: white; font-size: 60px; }