write html with tailwind styling
- User
write html with tailwind styling
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
write html with tailwind styling
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Here's an example of an HTML file with Tailwind CSS styling:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
<title>Tailwind CSS Example</title>
</head>
<body>
<div class="container mx-auto px-4">
<header class="py-6">
<h1 class="text-4xl font-bold text-center text-gray-800">Welcome to My Website</h1>
</header>
<main class="mt-8">
<section class="bg-white rounded-lg shadow-md p-6">
<h2 class="text-2xl font-semibold mb-4">About Us</h2>
<p class="text-gray-600">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam in dui mauris. Vivamus hendrerit arcu sed erat molestie vehicula. Sed auctor neque eu tellus rhoncus ut eleifend nibh porttitor.</p>
<button class="mt-4 bg-blue-500 hover:bg-blue-600 text-white font-semibold py-2 px-4 rounded">Learn More</button>
</section>
<section class="mt-8 bg-gray-100 rounded-lg shadow-md p-6">
<h2 class="text-2xl font-semibold mb-4">Our Services</h2>
<ul class="list-disc list-inside text-gray-600">
<li>Service 1</li>
<li>Service 2</li>
<li>Service 3</li>
</ul>
</section>
</main>
<footer class="mt-8 py-4 bg-gray-800 text-white text-center">
© 2023 My Website. All rights reserved.
</footer>
</div>
</body>
</html>
In this example:
We include the Tailwind CSS stylesheet using a CDN link in the <head> section.
We use Tailwind utility classes to style various elements throughout the HTML file.
The container class centers the content and sets a max-width based on the screen size.
We use classes like text-4xl, font-bold, text-center, and text-gray-800 to style the heading.
The mt-8 class adds margin-top to create vertical spacing between sections.
We use bg-white, rounded-lg, shadow-md, and p-6 classes to style the sections with a white background, rounded corners, a shadow effect, and padding.
The text-2xl and font-semibold classes are used for section headings.
We use text-gray-600 to apply a gray color to the paragraph text.
The button is styled using bg-blue-500, hover:bg-blue-600, text-white, font-semibold, py-2, px-4, and rounded classes.
The footer is styled with a dark gray background (bg-gray-800), white text (text-white), and centered text (text-center).
This is just a basic example to demonstrate how Tailwind CSS classes can be used to style an HTML file. You can customize and expand upon this example based on your specific design requirements.