How to create contact Us page using HTML code

 


Introduction 

  • Creating a Contact Us page using HTML code is relatively straightforward. Here's a step-by-step guide to help you:
  • Open a text editor or integrated development environment (IDE) on your computer.
  • Create a new HTML file and save it with a suitable name, such as "contact.html".
  • Copy and paste the following code into the file.

Simple contact Us page 

<!DOCTYPE html>

<html>

<head>

 <title>Contact Us</title>

</head>

<body>

 <h1>Contact Us</h1>

 <form>

  <label for="name">Name:</label>

  <input type="text" id="name" name="name" required><br><br>

  <label for="email">Email:</label>

  <input type="email" id="email" name="email" required><br><br>

  <label for="message">Message:</label><br>

  <textarea id="message" name="message" rows="5" cols="50" required></textarea><br><br>

  <input type="submit" value="Submit">

 </form>

</body>

</html>

  • Save the file.
  • Open the HTML file in a web browser to see the Contact Us page.
  • This code includes a simple form with three fields - name, email, and message - and a Submit button. The "required" attribute ensures that the user must fill out these fields before submitting the form.
  • You can further customize the Contact Us page by adding CSS styling and JavaScript functionality to make it more user-friendly and visually appealing.

Stylish contact Us page using HTML code 

  • stylish Contact Us page design using HTML and CSS:

<!DOCTYPE html>

<html>

<head>

 <title>Contact Us</title>

 <meta name="viewport" content="width=device-width, initial-scale=1">

 <style>

  body {

   font-family: Arial, Helvetica, sans-serif;

   margin: 0;

   padding: 0;

   background-color: #f2f2f2;

  }

  

  .container {

   width: 80%;

   margin: auto;

   background-color: #fff;

   padding: 20px;

   box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.1);

   border-radius: 10px;

   margin-top: 50px;

  }

  

  h1 {

   text-align: center;

   color: #4CAF50;

   margin-top: 0;

  }

  

  form {

   display: flex;

   flex-direction: column;

   align-items: center;

  }

  

  input[type="text"], input[type="email"], textarea {

   padding: 10px;

   margin-bottom: 20px;

   border: none;

   border-radius: 5px;

   box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.1);

   width: 100%;

   max-width: 500px;

   font-size: 16px;

  }

  

  textarea {

   height: 200px;

  }

  

  input[type="submit"] {

   background-color: #4CAF50;

   color: white;

   padding: 10px 20px;

   border: none;

   border-radius: 5px;

   cursor: pointer;

   transition: background-color 0.3s ease;

   font-size: 16px;

   width: 150px;

   align-self: center;

   margin-top: 10px;

  }

  

  input[type="submit"]:hover {

   background-color: #3e8e41;

  }

  

  @media screen and (max-width: 600px) {

   .container {

    width: 100%;

    border-radius: 0;

    box-shadow: none;

    margin-top: 0;

   }

  }

 </style>

</head>

<body>

 <div class="container">

  <h1>Contact Us</h1>

  <form action="#" method="post">

   <label for="name">Name:</label>

   <input type="text" id="name" name="name" required>

   

   <label for="email">Email:</label>

   <input type="email" id="email" name="email" required>

   

   <label for="message">Message:</label>

   <textarea id="message" name="message" required></textarea>

   

   <input type="submit" value="Send">

  </form>

 </div>

</body>

</html>

Output 


  • In this design, we've added some CSS styles to give the page a modern and visually appealing look. 
  • The container class adds a background color, padding, and a box-shadow effect to the form. The h1 tag is centered and colored green using the color #4CAF50. 
  • We've also added a media query that adjusts the container class to full-width when the screen size is less than 600px.
  • Feel free to customize this design by changing the colors, fonts, or layout to suit your website's branding and style.

Professional contact us page using HTML code 

  • professional Contact Us page design using HTML and CSS:
<!DOCTYPE html>
<html>
<head>
 <title>Contact Us</title>
 <meta name="viewport" content="width=device-width, initial-scale=1">
 <style>
  body {
   font-family: Arial, Helvetica, sans-serif;
   margin: 0;
   padding: 0;
   background-color: #f2f2f2;
  }
  
  .container {
   width: 80%;
   margin: auto;
   background-color: #fff;
   padding: 20px;
   box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.1);
   border-radius: 10px;
   margin-top: 50px;
   display: flex;
   flex-direction: column;
   align-items: center;
  }
  
  h1 {
   text-align: center;
   color: #333;
   padding: 10px 20px;
   border-radius: 5px;
   margin-top: 0;
   font-size: 32px;
   margin-bottom: 30px;
  }
  
  form {
   display: flex;
   flex-direction: column;
   align-items: center;
   max-width: 500px;
   width: 100%;
  }
  
  label {
   color: #333;
   font-size: 18px;
   margin-bottom: 10px;
   align-self: flex-start;
   font-weight: bold;
  }
  
  input[type="text"], input[type="email"], textarea {
   padding: 10px;
   margin-bottom: 20px;
   border: none;
   border-radius: 5px;
   box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.1);
   width: 100%;
   max-width: 500px;
   font-size: 16px;
   color: #333;
   background-color: #f2f2f2;
  }
  
  textarea {
   height: 200px;
  }
  
  input[type="submit"] {
   background-color: #333;
   color: white;
   padding: 10px 20px;
   border: none;
   border-radius: 5px;
   cursor: pointer;
   transition: background-color 0.3s ease;
   font-size: 16px;
   width: 150px;
   align-self: center;
   margin-top: 10px;
   font-weight: bold;
  }
  
  input[type="submit"]:hover {
   background-color: #555;
  }
 </style>
</head>
<body>
 <div class="container">
  <h1>Contact Us</h1>
  <form action="#" method="post">
   <label for="name">Name:</label>
   <input type="text" id="name" name="name" required>
   
   <label for="email">Email:</label>
   <input type="email" id="email" name="email" required>
   
   <label for="message">Message:</label>
   <textarea id="message" name="message" required></textarea>
   
   <input type="submit" value="Send">
  </form>
 </div>
</body>
</html>

Output 


  • In this design, we've used a more subdued color scheme with shades of gray and black to give the page a professional and business-like look. 



Post a Comment

0 Comments