Sure! Here's a large chunk of random HTML code (approximately 1,000 tokens) that you can use for testing purposes. It includes various HTML elements, some inline CSS, and JavaScript to make it more comprehensive.
html Copy code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Random HTML Test Page</title>
<style>
body {
font-family: Arial, sans-serif;
background: #f4f4f9;
margin: 0;
padding: 0;
}
header {
background: #333;
color: white;
padding: 1rem 2rem;
text-align: center;
}
nav {
background: #444;
display: flex;
justify-content: center;
gap: 1rem;
padding: 0.5rem 0;
}
nav a {
color: white;
text-decoration: none;
font-weight: bold;
padding: 0.5rem 1rem;
border-radius: 4px;
}
nav a:hover {
background: #666;
}
main {
max-width: 900px;
margin: 2rem auto;
padding: 0 1rem;
}
section {
background: white;
margin-bottom: 2rem;
padding: 1rem 2rem;
border-radius: 8px;
box-shadow: 0 0 8px rgba(0,0,0,0.1);
}
h2 {
color: #333;
}
ul {
list-style-type: square;
padding-left: 1.5rem;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 1rem;
}
table, th, td {
border: 1px solid #ccc;
}
th, td {
padding: 0.5rem;
text-align: left;
}
th {
background: #eee;
}
button {
background: #007BFF;
color: white;
border: none;
padding: 0.5rem 1rem;
border-radius: 4px;
cursor: pointer;
font-size: 1rem;
}
button:hover {
background: #0056b3;
}
footer {
background: #222;
color: #ccc;
text-align: center;
padding: 1rem 0;
margin-top: 3rem;
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fit,minmax(150px,1fr));
gap: 1rem;
}
.card {
background: #fafafa;
border: 1px solid #ddd;
border-radius: 6px;
padding: 1rem;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.card h3 {
margin-top: 0;
}
input[type="text"], input[type="email"], textarea {
width: 100%;
padding: 0.5rem;
margin-top: 0.25rem;
margin-bottom: 1rem;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1rem;
}
label {
font-weight: bold;
}
</style>
</head>
<body>
<header>
<h1>Random HTML Test Page</h1>
</header>
<nav>
<a href="#section1">Introduction</a>
<a href="#section2">Features</a>
<a href="#section3">Gallery</a>
<a href="#section4">Contact</a>
</nav>
<main>
<section id="section1">
<h2>Introduction</h2>
<p>Welcome to this randomly generated HTML test page. This page contains various HTML elements including text, lists, tables, forms, and interactive buttons to help you test your HTML parser or renderer.</p>
<p>Below is a list of random facts:</p>
<ul>
<li>The honeybee can recognize human faces.</li>
<li>Octopuses have three hearts.</li>
<li>Bananas are berries, but strawberries are not.</li>
<li>There are more stars in the universe than grains of sand on Earth.</li>
<li>Sharks have been around longer than trees.</li>
</ul>
</section>
<section id="section2">
<h2>Features Table</h2>
<table>
<thead>
<tr>
<th>Feature</th>
<th>Description</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>Responsive Design</td>
<td>Adapts layout to different screen sizes.</td>
<td>Implemented</td>
</tr>
<tr>
<td>Dark Mode</td>
<td>Switches color scheme to dark colors.</td>
<td>Planned</td>
</tr>
<tr>
<td>Accessibility</td>
<td>Supports screen readers and keyboard navigation.</td>
<td>In Progress</td>
</tr>
<tr>
<td>Animations</td>
<td>Smooth transitions and effects.</td>
<td>Implemented</td>
</tr>
</tbody>
</table>
<button id="toggleStatusBtn">Toggle Status Colors</button>
</section>
<section id="section3">
<h2>Gallery</h2>
<div class="grid">
<div class="card">
<h3>Sunset</h3>
<img src="https://via.placeholder.com/150x100?text=Sunset" alt="Sunset" />
<p>A beautiful sunset over the mountains.</p>
</div>
<div class="card">
<h3>Forest</h3>
<img src="https://via.placeholder.com/150x100?text=Forest" alt="Forest" />
<p>Lush green forest with tall trees.</p>
</div>
<div class="card">
<h3>Ocean</h3>
<img src="https://via.placeholder.com/150x100?text=Ocean" alt="Ocean" />
<p>Vast blue ocean under a clear sky.</p>
</div>
<div class="card">
<h3>Cityscape</h3>
<img src="https://via.placeholder.com/150x100?text=Cityscape" alt="Cityscape" />
<p>Night view of a bustling city.</p>
</div>
</div>
</section>
<section id="section4">
<h2>Contact Us</h2>
<form id="contactForm" action="#" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name" placeholder="Your full name" required />
<label for="email">Email:</label>
<input type="email" id="email" name="email" placeholder="your.email@example.com" required />
<label for="message">Message:</label>
<textarea id="message" name="message" rows="5" placeholder="Write your message here..." required></textarea>
<button type="submit">Send Message</button>
</form>
<p id="formResponse" style="color: green; font-weight: bold; display: none;">Thank you for contacting us!</p>
</section>
</main>
<footer>
<p>© 2024 Random HTML Test Page. All rights reserved.</p>
</footer>
<script>
// Toggle status colors in the features table
const toggleBtn = document.getElementById('toggleStatusBtn');
const rows = document.querySelectorAll('#section2 tbody tr');
let colored = false;
toggleBtn.addEventListener('click', () => {
rows.forEach(row => {
const statusCell = row.cells[2];
if (!colored) {
switch(statusCell.textContent.trim()) {
case 'Implemented':
statusCell.style.backgroundColor = '#d4edda'; // greenish
statusCell.style.color = '#155724';
break;
case 'Planned':
statusCell.style.backgroundColor = '#fff3cd'; // yellowish
statusCell.style.color = '#856404';
break;
case 'In Progress':
statusCell.style.backgroundColor = '#d1ecf1'; // bluish
statusCell.style.color = '#0c5460';
break;
default:
statusCell.style.backgroundColor = '';
statusCell.style.color = '';
}
} else {
statusCell.style.backgroundColor = '';
statusCell.style.color = '';
}
});
colored = !colored;
});
// Simple form submission handler
const form = document.getElementById('contactForm');
const response = document.getElementById('formResponse');
form.addEventListener('submit', (e) => {
e.preventDefault();
// Normally here you would send data to server
form.style.display = 'none';
response.style.display = 'block';
});
</script>
</body>
</html>