Website Components List

Website Components List

Header Section


<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Header with Navigation</title>
  <style>
    .main-header {
      background-color: #333;
      color: white;
      padding: 20px;
      text-align: center;
    }
    .nav-bar {
      margin-top: 10px;
    }
    .nav-bar a {
      color: white;
      margin: 0 15px;
      text-decoration: none;
    }
    .nav-bar a:hover {
      text-decoration: underline;
    }
  </style>
</head>
<body>
  <header class="main-header">
    <h1>My Website</h1>
    <nav class="nav-bar">
      <a href="#">Home</a>
      <a href="#">About</a>
      <a href="#">Services</a>
      <a href="#">Contact</a>
    </nav>
  </header>
</body>
</html>

Search Bar


<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Header with Navigation</title>
  <style>
    /* Search Bar Styling */
    .search-section {
      text-align: center;
      margin: 30px 0;
    }

    .search-section input[type="text"] {
      padding: 10px;
      width: 250px;
      border: 1px solid #ccc;
      border-radius: 5px;
    }

    .search-section button {
      padding: 10px 20px;
      margin-left: 10px;
      background-color: #007bff;
      color: white;
      border: none;
      border-radius: 5px;
      cursor: pointer;
    }

    .search-section button:hover {
      background-color: #0056b3;
    }
  </style>
</head>
<body>
  <!-- Search Bar Section -->
  <section class="search-section">
    <input type="text" id="searchInput" placeholder="Search here...">
    <button onclick="searchFunction()">Search</button>
  </section>

  <!-- JS for search bar -->
  <script>
    function searchFunction() {
      let query = document.getElementById("searchInput").value;
      if (query.trim() !== "") {
        alert("You searched for: " + query);
      } else {
        alert("Please enter something to search.");
      }
    }
  </script>
</body>
</html>


Header with Logo


<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Header with Navigation</title>
  <style>
      /* Header Container Layout */
    .main-header {
      background-color: #222;
      padding: 15px 30px;
    }

    .logo-nav-container {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .site-logo {
      display: flex;
      align-items: center;
    }

    .site-logo img {
      height: 40px;
      margin-right: 10px;
    }

    .site-logo span {
      font-size: 20px;
      color: white;
      font-weight: bold;
    }

    .nav-bar a {
      color: white;
      text-decoration: none;
      margin-left: 20px;
      font-size: 16px;
    }

    .nav-bar a:hover {
      text-decoration: underline;
    }
  </style>
</head>
<body>
    <!-- Header with Logo -->
  <header class="main-header">
    <div class="logo-nav-container">
      <div class="site-logo">
        <img src="logo.png" alt="Logo" />
        <span>MyWebsite</span>
      </div>
      <nav class="nav-bar">
        <a href="#">Home</a>
        <a href="#">About</a>
        <a href="#">Services</a>
        <a href="#">Contact</a>
      </nav>
    </div>
  </header>
  

Footer Section


<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8"/>
  <title>Header with Navigation</title>
  <style>
    /* Ensure full height for the page */
    html, body {
      height: 100%;
      margin: 0;
      display: flex;
      flex-direction: column;
    }

    /* Main content will take up all available space */
    .content {
      flex: 1;
    }

    /* Footer Styling */
    .main-footer {
      background-color: #333;
      color: white;
      text-align: center;
      padding: 20px;
    }
  </style>
</head>
<body>

  <!-- Main content area -->
  <div class="content">
    <p style="text-align:center; margin-top: 200px;">
      Your Page Content Goes Here
    </p>
  </div>

  <!-- Footer Section -->
  <footer class="main-footer">
    &copy; 2025 <span>My Website</span> | 
    <span>All Rights Reserved</span>
  </footer>

</body>
</html>

Sign Up or Log In | Simple Auth Form


<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8"/>
  <title>Simple Auth Form</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background: #f5f5f5;
      padding: 40px;
      text-align: center;
    }

    .form-container {
      background: #fff;
      max-width: 400px;
      margin: auto;
      padding: 30px;
      box-shadow: 0 0 10px rgba(0,0,0,0.1);
      border-radius: 10px;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"] {
      width: 100%;
      padding: 12px;
      margin: 10px 0;
      border: 1px solid #ccc;
      border-radius: 5px;
    }

    button {
      padding: 12px 25px;
      background: #007bff;
      color: white;
      border: none;
      border-radius: 5px;
      cursor: pointer;
    }

    button:hover {
      background: #0056b3;
    }

    .link {
      color: #007bff;
      cursor: pointer;
      display: block;
      margin-top: 10px;
    }

    h2 {
      margin-bottom: 20px;
    }

    .hidden {
      display: none;
    }
  </style>
</head>
<body>

  <!-- Sign Up Form -->
  <div id="signupForm" class="form-container">
    <h2>Create Account</h2>
    <input type="text" id="firstName" placeholder="First Name"/>
    <input type="text" id="lastName" placeholder="Last Name"/>
    <input type="email" id="signupEmail" placeholder="Email"/>
    <input type="password" id="signupPassword" placeholder="Password"/>
    <button onclick="submitSignup()">Sign Up</button>
    <span class="link" onclick="switchToLogin()">Already have an account? Sign In</span>
  </div>

  <!-- Sign In Form -->
  <div id="loginForm" class="form-container hidden">
    <h2>Sign In</h2>
    <input type="email" id="loginEmail" placeholder="Email"/>
    <input type="password" id="loginPassword" placeholder="Password"/>
    <button onclick="submitLogin()">Sign In</button>
    <span class="link" onclick="switchToSignup()">Don't have an account? Sign Up</span>
    <span class="link" onclick="forgotPassword()">Forgot Password?</span>
  </div>

  <!-- JavaScript -->
  <script>
    function switchToLogin() {
      document.getElementById('signupForm').classList.add('hidden');
      document.getElementById('loginForm').classList.remove('hidden');
    }

    function switchToSignup() {
      document.getElementById('loginForm').classList.add('hidden');
      document.getElementById('signupForm').classList.remove('hidden');
    }

    function submitSignup() {
      let fname = document.getElementById('firstName').value;
      let lname = document.getElementById('lastName').value;
      let email = document.getElementById('signupEmail').value;
      let password = document.getElementById('signupPassword').value;

if (fname && lname && email && password) {
        alert("Account Created Successfully!\nName: " + fname + " " + lname + "\nEmail: " + email);
        switchToLogin();
      } else {
        alert("Please fill in all fields.");
      }
    }

    function submitLogin() {
      let email = document.getElementById('loginEmail').value;
      let password = document.getElementById('loginPassword').value;

if (email && password) {
alert("Welcome back! Logged in as " + email);
      } else {
        alert("Please enter both email and password.");
      }
    }

    function forgotPassword() {
      let email = prompt("Enter your registered email:");
      if (email) {
        alert("Reset link sent to: " + email);
      } else {
        alert("Please enter your email.");
      }
    }
  </script>
</body>
</html>

Link

  <a 
  href="https://www.example.com" 
  target="_blank"
  >Visit Example</a>

Image

  <img 
  src="logo.png" 
  alt="Website Logo" 
  width="150" 
  />
Previous Post Next Post