Certainly! Here’s how you can modify the startpage to display the categories in a grid layout, making room for more links per row. Additionally, the entire content is centered vertically and horizontally on the page using CSS Flexbox for ultimate alignment and convenience.
Below is the updated HTML/CSS code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="The Greatest Startpage Ever">
<title>Greatest Startpage Ever</title>
<style>
/* General Reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html, body {
height: 100%;
font-family: Arial, sans-serif;
background-color: #121212; /* Dark background */
color: #ffffff; /* White text */
}
body {
display: flex;
justify-content: center;
align-items: center;
text-align: center;
flex-direction: column;
}
h1 {
font-size: 3rem;
color: #4caf50;
margin-bottom: 20px;
}
.search-container {
width: 100%;
max-width: 600px;
margin-bottom: 40px;
}
.search-container form {
display: flex;
}
.search-input {
width: 100%;
padding: 15px;
border-radius: 25px 0 0 25px;
border: none;
outline: none;
font-size: 1.2rem;
background-color: #2c2c2c; /* Input background */
color: #ffffff;
}
.search-button {
padding: 14px 20px;
border-radius: 0 25px 25px 0;
border: none;
background-color: #4caf50; /* Accent color */
color: #ffffff;
font-size: 1.2rem;
cursor: pointer;
transition: background-color 0.3s ease;
}
.search-button:hover {
background-color: #45a049;
}
.links-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Grid layout: responsive columns */
gap: 20px;
max-width: 1200px;
width: 100%;
margin: 20px auto 0;
}
.category {
background-color: #1e1e1e;
padding: 15px;
border-radius: 10px;
}
.category-title {
font-size: 1.2rem;
color: #4caf50;
margin-bottom: 10px;
}
.links {
display: flex;
flex-wrap: wrap;
flex-direction: column;
gap: 10px;
}
.links a {
text-decoration: none;
color: white;
background-color: #2c2c2c;
padding: 10px 15px;
border-radius: 5px;
transition: all 0.3s ease;
font-size: 0.9rem;
}
.links a:hover {
background-color: #4caf50;
color: #ffffff;
}
footer {
margin-top: 40px;
color: #757575;
font-size: 0.9rem;
}
footer a {
color: #4caf50;
text-decoration: none;
transition: color 0.3s ease;
}
footer a:hover {
color: #45a049;
}
</style>
</head>
<body>
<h1>Welcome to the Greatest Startpage</h1>
<!-- Search Bar -->
<div class="search-container">
<form action="https://www.google.com/search" method="GET">
<input type="text" name="q" class="search-input" placeholder="Search Google...">
<button type="submit" class="search-button">Search</button>
</form>
</div>
<!-- Links Section -->
<div class="links-container">
<!-- Social Media -->
<div class="category">
<h2 class="category-title">Social Media</h2>
<div class="links">
<a href="https://www.facebook.com" target="_blank">Facebook</a>
<a href="https://www.twitter.com" target="_blank">Twitter</a>
<a href="https://www.instagram.com" target="_blank">Instagram</a>
<a href="https://www.linkedin.com" target="_blank">LinkedIn</a>
<a href="https://www.tiktok.com" target="_blank">TikTok</a>
</div>
</div>
<!-- News -->
<div class="category">
<h2 class="category-title">News</h2>
<div class="links">
<a href="https://www.bbc.com" target="_blank">BBC</a>
<a href="https://www.cnn.com" target="_blank">CNN</a>
<a href="https://www.nytimes.com" target="_blank">NY Times</a>
<a href="https://www.theguardian.com" target="_blank">The Guardian</a>
<a href="https://www.reuters.com" target="_blank">Reuters</a>
</div>
</div>
<!-- Technology -->
<div class="category">
<h2 class="category-title">Technology</h2>
<div class="links">
<a href="https://www.techcrunch.com" target="_blank">TechCrunch</a>
<a href="https://www.wired.com" target="_blank">Wired</a>
<a href="https://www.theverge.com" target="_blank">The Verge</a>
<a href="https://www.github.com" target="_blank">GitHub</a>
<a href="https://www.stackoverflow.com" target="_blank">Stack Overflow</a>
</div>
</div>
<!-- Entertainment -->
<div class="category">
<h2 class="category-title">Entertainment</h2>
<div class="links">
<a href="https://www.netflix.com" target="_blank">Netflix</a>
<a href="https://www.youtube.com" target="_blank">YouTube</a>
<a href="https://www.spotify.com" target="_blank">Spotify</a>
<a href="https://www.hulu.com" target="_blank">Hulu</a>
<a href="https://www.twitch.tv" target="_blank">Twitch</a>
</div>
</div>
</div>
<footer>
<p>Designed with <span style="color: red;">♥</span> by You - <a href="https://github.com/yourprofile" target="_blank">GitHub</a></p>
</footer>
</body>
</html>
Key Improvements:
-
Grid Layout:
- Categories are arranged in a responsive grid (
grid-template-columns) where each category forms a box.
- The
auto-fit ensures the grid adapts to different screen sizes.
-
Vertical and Horizontal Centering:
- The entire content is centered on the page using
display: flex along with justify-content: center and align-items: center.
-
Responsive Design:
- The links and categories shrink and rearrange nicely for mobile devices (thanks to the
minmax functionality in the grid).
-
Clean Design:
- Each category is enclosed in a subtle card-style box (
.category) with rounded corners.
- Links are neatly segmented with hover effects for better visual feedback.
This design ensures maximal usability and elegance, providing your users with a functional, well-organized, and visually appealing start page! ✨