AltoCode
Irsina

HTML
<!-- ============================================ -->
<!-- FORM -->
<!-- ============================================ -->
<section id="cta-302">
<div class="cs-container">
<div class="cs-content">
<span class="cs-topper">Iscriviti</span>
<h2 class="cs-title">Iscrivi la tua Email per Newsletter e Promozioni</h2>
<p class="cs-text">
La nostra newsletter è il modo migliore per restare connesso alle ultime novità e alle offerte più interessanti.
</p>
<form class="cs-form" name="Form contatti" method="post">
<input class="cs-input" type="email" id="cs-email-302" name="find-us" placeholder="Indirizzo email">
<button class="cs-button-solid cs-submit" type="submit">Iscriviti Ora</button>
</form>
</div>
</div>
<picture class="cs-background">
<source media="(max-width: 600px)" srcset="https://csimg.nyc3.digitaloceanspaces.com/CTA/scale-m.jpg">
<source media="(min-width: 601px)" srcset="https://csimg.nyc3.digitaloceanspaces.com/CTA/scale.jpg">
<img loading="lazy" decoding="async" src="https://csimg.nyc3.digitaloceanspaces.com/CTA/scale.jpg" alt="stretta di mano sfondo" width="1920" height="486">
</picture>
</section>
CSS
/*-- -------------------------- -->
<--- FORM -->
<--- -------------------------- -*/
/* Mobile - 360px */
@media only screen and (min-width: 0rem) {
#cta-302 {
padding: var(--sectionPadding);
position: relative;
z-index: 1;
}
#cta-302 .cs-container {
width: 100%;
max-width: 34.375rem;
margin: auto;
display: flex;
flex-direction: column;
align-items: center;
gap: clamp(3rem, 6vw, 4rem);
}
#cta-302 .cs-content {
text-align: center;
width: 100%;
max-width: 39.375rem;
display: flex;
flex-direction: column;
align-items: center;
}
#cta-302 .cs-topper {
color: var(--secondaryLight);
}
#cta-302 .cs-title {
max-width: 20ch;
color: var(--bodyTextColorWhite);
}
#cta-302 .cs-text {
margin: 0 0 2rem 0;
color: var(--bodyTextColorWhite);
}
#cta-302 .cs-form {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 1rem;
}
#cta-302 .cs-input {
font-size: 1rem;
width: 100%;
height: clamp(2.875rem, 5.5vw, 3.5rem);
margin: 0;
padding: 0;
padding-left: 1.25rem;
border: none;
border-radius: 0.25rem;
box-sizing: border-box;
display: block;
}
#cta-302 .cs-input::placeholder {
color: #767676;
}
#cta-302 .cs-button-solid {
font-size: 1rem;
line-height: clamp(2.875rem, 5.5vw, 3.5rem);
text-decoration: none;
font-weight: 700;
text-align: center;
margin: 0;
color: #fff;
min-width: 9.375rem;
padding: 0 1.5rem;
background-color: var(--primaryLight);
border-radius: 0.25rem;
display: inline-block;
position: relative;
z-index: 1;
box-sizing: border-box;
}
#cta-302 .cs-button-solid:before {
content: "";
position: absolute;
height: 100%;
width: 0%;
background: #000;
opacity: 1;
top: 0;
left: 0;
z-index: -1;
border-radius: 0.25rem;
transition: width 0.3s;
}
#cta-302 .cs-button-solid:hover:before {
width: 100%;
}
#cta-302 .cs-submit {
width: 100%;
color: var(--headerColor);
border: none;
}
#cta-302 .cs-background {
width: 100%;
height: 100%;
display: block;
position: absolute;
top: 0;
left: 0;
z-index: -1;
}
#cta-302 .cs-background:before {
content: "";
width: 100%;
height: 100%;
background: #000;
opacity: 0.6;
position: absolute;
display: block;
top: 0;
left: 0;
z-index: 1;
}
#cta-302 .cs-background img {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
object-fit: cover;
}
}
/* Tablet - 768px */
@media only screen and (min-width: 48rem) {
#cta-302 .cs-container {
max-width: 80rem;
}
#cta-302 .cs-form {
flex-direction: row;
}
#cta-302 .cs-input {
width: 22.5rem;
}
#cta-302 .cs-submit {
width: 13.875rem;
}
}
/* Desktop 1300px - Parallax Scroll */
@media only screen and (min-width: 81.25rem) {
#cta-302 {
background: url("https://csimg.nyc3.digitaloceanspaces.com/CTA/scale.jpg");
background-size: cover;
background-position: center 20%;
background-repeat: no-repeat;
background-attachment: fixed;
}
#cta-302 .cs-background img {
display: none;
}
}