Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 25 additions & 38 deletions newsletter-sign-up-with-success-message-main/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,38 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- displays site properly based on user's device -->

<link rel="icon" type="image/png" sizes="32x32" href="./assets/images/favicon-32x32.png">

<title>Frontend Mentor | Newsletter sign-up form with success message</title>
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="icon" type="image/png" sizes="32x32" href="./assets/images/favicon-32x32.png">

<!-- Feel free to remove these styles or customise in your own stylesheet 👍 -->
<title>Frontend Mentor | Newsletter sign-up form with success message</title>
<style>
.attribution { font-size: 11px; text-align: center; }
.attribution a { color: hsl(228, 45%, 44%); }
</style>
</head>
<body>

<!-- Sign-up form start -->

Stay updated!

Join 60,000+ product managers receiving monthly updates on:

Product discovery and building what matters
<div class="box">
<div class="right-side">
<h1>Stay updated!</h1>
<p>Join 60,000+ product managers receiving monthly updates on:</p>
<div class="line">
<img class="ok-img" src="assets/images/icon-success.svg" alt="success">
Product discovery and building what matters
</div>
<div class="line">
<img class="ok-img" src="assets/images/icon-success.svg" alt="success">
Measuring to ensure updates are a success
And much more!

Email address
email@company.com

Subscribe to monthly newsletter

<!-- Sign-up form end -->

<!-- Success message start -->

Thanks for subscribing!

A confirmation email has been sent to ash@loremcompany.com.
Please open it and click the button inside to confirm your subscription.

Dismiss message

<!-- Success message end -->

<div class="attribution">
Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>.
Coded by <a href="#">Your Name Here</a>.
</div>
<div class="line">
<img class="ok-img" src="assets/images/icon-success.svg" alt="success">
And much more!
</div>
<form>
<label class="Email-label" for="email-textbox">Email address</label>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to be consistent with your other code so I would write this as email-label without the capital e

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to be consistent with your other code so I would write this as email-label without the capital e

<input type="email" id="email-textbox" name="email-textbox" placeholder="email@company.com" required><br><br>
<button class="subscribe">Subscribe to monthly newsletter</button>
</form>
</div>
<img class="img-data" src="assets/images/illustration-sign-up-desktop.svg" alt="">
</div>
</body>
</html>
136 changes: 136 additions & 0 deletions newsletter-sign-up-with-success-message-main/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@

* {
box-sizing: border-box;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great

}


body {
background-color: hsl(234, 29%, 20%);
margin: 0;
min-height: 100vh;
padding: 16px;
display: flex;
justify-content: center;
align-items: center;
font-family: system-ui, Arial, sans-serif;
}

.box {
display: flex;
flex-direction: column-reverse;
background-color: white;
border-radius: 20px;
color: hsl(234, 29%, 20%);
font-size: 12px;
gap: 20px;
width: 100%;
max-width: 400px;
padding: 24px 20px;
}


.right-side {
display: flex;
flex-direction: column;
gap: 15px;
text-align: left;
}

h1 {
font-size: 33px;
margin: 0 0 8px;
padding: 0;
}

.first-message {
margin: 0 0 8px;
font-size: 13px;
line-height: 1.8;
}

.line {
display: flex;
align-items: center;
gap: 12px;
font-size: 13px;
}

.ok-img {
width: 15px;
height: 15px;
display: block;
}

.img-data {
max-width: 100%;
height: auto;
display: block;
align-self: center;
}

.newsletter-form {
display: flex;
flex-direction: column;
}

.email-label {
font-weight: bold;
font-size: 12px;
margin-top: 14px;
padding-bottom: 10px;
}

#email-textbox {
border: 1px solid rgb(177, 177, 177);
border-radius: 5px;
font-size: 12px;
padding: 12px;
width: 100%;
max-width: 280px;
text-align: left;
outline: none;
color: hsl(234, 29%, 20%);

}

.subscribe {
background-color: hsl(234, 29%, 20%);
color: white;
border: none;
border-radius: 5px;
font-size: 12px;
padding: 12px;
width: 100%;
max-width: 285px;
text-align: center;
cursor: pointer;
}


@media (min-width: 768px) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work in supporting mobile as well, btw this is supported as well :

@media (width <= 1250px) {

For more info check the docs

body {
padding: 40px 60px;
}

.box {
flex-direction: row;
align-items: center;
max-width: 700px;
padding: 40px 32px;
gap: 30px;
}

h1 {
font-size: 40px;
margin: 0 0 10px;
}

.first-message {
font-size: 14px;
margin-bottom: 12px;
}

.img-data {
max-width: 300px;
}
}