DEV Community

Cover image for Email Newsletter template using CSS
Manoj Rathod
Manoj Rathod

Posted on

2 2

Email Newsletter template using CSS

This is the tutorial about how to create Minimalistic Newsletter using CSS.

Demo

HTML code: -

<div class="container">
  <h1>Subscribe to the Newsletter</h1>
  <div class="mail_box">
  <input type="email" placeholder="Enter your email">
  <button>Submit</button>
  </div>
  <p class="footer">Created with ❤ by <span>Manoj Rathod</span></p>
</div>
Enter fullscreen mode Exit fullscreen mode

CSS code: -

@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap');

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}
body{
  background: #F5EEDC;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}
.container, .mail_box{
  display: flex;
  justify-content: center;
  align-items: center;
}
.container{
  width: 80%;
  height: 350px;
  padding: 50px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.3);
}
.mail_box{
  position : relative;
  border: 2px solid #0092ff;
  border-radius: 5px;
  width: 400px;
  height: 50px;
  padding: 10px;
  box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.3)
}
.mail_box input{
  background: none;
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  font-size: 15px;
  color: #0092ff;
}
input::placeholder{
  font-size: 15px;
}
button{
  position: absolute;
  right: -7px;
  padding: 9px 20px;
  border: 2px solid #0092ff;
  border-radius: 5px;
  outline: none;
  margin-right: 10px;
  background: #0092ff;
  color: #fff;
  cursor: pointer;
}
button:hover{
  background: #0d6efd;
}
.footer{
  position: absolute;
  bottom: 10px;
}
.footer span{
  color: #0d6efd;
}

Enter fullscreen mode Exit fullscreen mode

Billboard image

Deploy and scale your apps on AWS and GCP with a world class developer experience

Coherence makes it easy to set up and maintain cloud infrastructure. Harness the extensibility, compliance and cost efficiency of the cloud.

Learn more

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post