How to Create a Simple Login Page Using HTML and CSS
Creating a login page is a fundamental skill for any web developer. With just HTML and CSS, you can build a clean, functional login form. Here’s how:
1. HTML Structure
Start with a basic HTML file. The form will include fields for the username and password, and a login button.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login Page</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="login-container">
<h2>Login</h2>
<form>
<input type="text" placeholder="Username" required>
<input type="password" placeholder="Password" required>
<button type="submit">Login</button>
</form>
</div>
</body>
</html>
2. CSS Styling
Next, create a style.css file to style the login form.
body {
font-family: Arial, sans-serif;
background-color: #f0f2f5;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.login-container {
background-color: white;
padding: 40px;
border-radius: 10px;
box-shadow: 0 4px 10px rgba(0,0,0,0.1);
width: 300px;
text-align: center;
}
.login-container h2 {
margin-bottom: 20px;
color: #333;
}
.login-container input {
width: 100%;
padding: 12px;
margin: 10px 0;
border: 1px solid #ccc;
border-radius: 5px;
}
.login-container button {
width: 100%;
padding: 12px;
background-color: #007bff;
border: none;
color: white;
font-size: 16px;
border-radius: 5px;
cursor: pointer;
}
.login-container button:hover {
background-color: #0056b3;
}
3. How It Works
- HTML creates the form structure with input fields and a button.
- CSS styles the form to center it on the page and make it visually appealing.
- You can enhance this page by adding links for “Forgot Password?” or “Sign Up” and using JavaScript for form validation.
4. Result
You now have a simple, responsive login page ready to use!
-
Cole Palmer named as the “Premier League player of the week” for game week 25
Cole Palmer’s performance against Wolves this weekend was nothing short of special, and it fully explains why he has officially been named Premier League Player of the Week. The Chelsea star delivered a clinical first half hat trick that stunned the home crowd and set the tone for a dominant display. His confidence, composure, and…
-
ULTRAMAXTECHNOLOGIES DATA SOLUTIONS.
ARE YOU IN KENYA USING A SAFARICOM SIM CARD? Tired of expensive bundles that finish too fast? Need cheap, fast and reliable data, SMS or minutes every day? We’ve got you covered ✅ Get affordable Safaricom deals instantly through our legit, trusted and fully automated system working 24/7.No delays. No stress. Just pay and receive…
-
Custom Website vs WordPress Website: What’s the Difference?
If you’re planning to build a website, one of the first decisions you’ll face is whether to go with a custom-built website or a WordPress website. Both options are popular, powerful, and widely used—but they serve different needs. Understanding the differences can help you choose the right approach for your goals, budget, and long‑term plans.…
-
Why Ultramax Technologies Is Investing in Its Own Servers
As Ultramax Technologies continues to grow, our mission remains clear: deliver reliable, secure, and high-performance digital solutions to our clients. To achieve this, we are taking a major step forward—investing in our own server infrastructure. What Does Owning Servers Mean? Owning servers means we operate and manage our own physical server hardware instead of relying…
-
Europa League Matchday 8
Europa League Matchday 8 Delivers Drama as Europe Lights Up at 23:00 EAT As the clock strikes 23:00 EAT, the UEFA Europa League Matchday 8 fixtures have either reached their decisive moments or already produced results across Europe. This final round of the league phase has lived up to expectations, delivering tension, goals, and defining…
-
Champions League Night
A Long Awaited Champions League Night Is Finally Here After weeks of anticipation, debates, predictions, and endless discussions among football fans, the moment we have all been waiting for has finally arrived. Tonight, Europe lights up as the UEFA Champions League League Phase takes center stage, delivering one of the most exciting football nights of…
-
Donald Trump Frames Photo With Cristiano Ronaldo at the White House
In a move that has sparked conversation across both political and sports circles, U.S. President Donald Trump has reportedly framed and displayed a photograph of himself alongside global football icon Cristiano Ronaldo at the White House. The unexpected pairing has quickly gone viral, igniting debates, memes, and widespread speculation about the meaning behind the gesture.…
-
AI Is Saving Jobs, Not Taking Them: The Truth Behind the AI Revolution
The Biggest Myth About AI Many people believe artificial intelligence is here to replace humans, but the reality is very different. AI is saving jobs by transforming how we work, increasing efficiency, and opening doors to new career opportunities instead of shutting them. Just like the internet and smartphones, AI is a tool that helps…
-
How Much Can You Earn From a Blog Website Per Month?
Blogging is no longer just a hobby. Today, it’s a real online business that can generate passive income every month. But the most common question beginners ask is: How much can we earn from a blog website per month? The short answer is: it depends. The long answer is explained below Average Monthly Income From…












