Skip to content

subhajitroycode/newsletter-sign-up-with-success-message

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - Newsletter sign-up form with success message solution

This is a solution to the Newsletter sign-up form with success message challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

The challenge

Users should be able to:

  • Add their email and submit the form
  • See a success message with their email after successfully submitting the form
  • See form validation messages if:
    • The field is left empty
    • The email address is not formatted correctly
  • View the optimal layout for the interface depending on their device's screen size
  • See hover and focus states for all interactive elements on the page

Screenshot

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • React - JS library

What I learned

I get to learn about picture tag and how to use it, use new CSS media query syntax and useref hook to get the input value.

<picture>
    <source
        media="(max-width: 650px)"
        srcSet="/illustration-sign-up-mobile.svg"
    />
    <img
        src="illustration-sign-up-desktop.svg"
        alt="illustration of sign up"
    />
</picture>
@media (width <= 650px) {
  body {
    display: block;
  }
}

Useful resources

  • Picture tag - This helped me for picture tag.
  • Media Query Syntax - This is an amazing article which helped me finally understand the new media query syntax. I'd recommend it to anyone still learning this concept.

Author