DEV Community

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

Posted on

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

Top comments (0)