Write me a hero block using tailwind css
- User
Write me a hero block using tailwind css
Assistant
Here's a modern, responsive hero block using Tailwind CSS with a gradient background, call-to-action buttons, and visual elements:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Modern Hero Block</title> <script src="https://cdn.tailwindcss.com"></script> </head> <body> <!-- Hero Section --> <section class="relative bg-gradient-to-r from-indigo-900 via-purple-800 to-pink-700 overflow-hidden"> <!-- Decorative Circles --> <div class="absolute top-[-100px] left-[-100px] w-[400px] h-[400px] rounded-full bg-purple-900/20"></div> <div class="absolute bottom-[-150px] right-[-100px] w-[500px] h-[500px] rounded-full bg-pink-800/20"></div> <div class="container mx-auto px-4 py-28 relative z-10"> <div class="flex flex-col lg:flex-row items-center"> <!-- Content Column --> <div class="lg:w-1/2 text-center lg:text-left mb-16 lg:mb-0"> <h1 class="text-4xl md:text-5xl lg:text-6xl font-bold text-white leading-tight mb-6"> Transform Your Digital Experience </h1> <p class="text-lg md:text-xl text-indigo-100 mb-10 max-w-xl mx-auto lg:mx-0"> Powerful solutions for modern businesses. Streamline operations, boost productivity, and delight your customers. </p> <div class="flex flex-col sm:flex-row justify-center lg:justify-start gap-4"> <a href="#" class="px-8 py-4 bg-white text-indigo-900 font-bold rounded-lg shadow-lg hover:bg-gray-100 transition duration-300 text-center"> Get Started </a> <a href="#" class="px-8 py-4 border-2 border-white text-white font-bold rounded-lg hover:bg-white/10 transition duration-300 text-center"> View Demo </a> </div> </div> <!-- Image/Visual Column --> <div class="lg:w-1/2 flex justify-center"> <div class="relative"> <!-- Placeholder for illustration --> <div class="bg-gray-200 border-2 border-dashed rounded-xl w-64 h-64 md:w-80 md:h-80 relative overflow-hidden"> <!-- Mock graphic elements --> <div class="absolute top-1/4 left-1/4 w-32 h-32 rounded-full bg-purple-500/30"></div> <div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-40 h-40 rounded-lg bg-white/20 backdrop-blur-sm"></div> <div class="absolute bottom-8 right-8 w-16 h-16 rounded-lg bg-pink-500/40 rotate-45"></div> </div> </div> </div> </div> </div> <!-- Wave Divider --> <div class="absolute bottom-0 left-0 w-full overflow-hidden"> <svg viewBox="0 0 1200 120" preserveAspectRatio="none" class="fill-current text-white"> <path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25"></path> <path d="M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z" opacity=".5"></path> <path d="M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z"></path> </svg> </div> </section> </body> </html>Key features of this hero block:
-
Modern Gradient Background:
- Purple to pink gradient using
bg-gradient-to-r - Animated decorative circles with transparency
- Purple to pink gradient using
-
Responsive Layout:
- Single column on mobile
- Two-column layout on larger screens
- Proper spacing adjustments for different screen sizes
-
Visual Elements:
- Abstract placeholder graphic (replace with your image)
- Wave divider at the bottom for visual interest
- Floating circular elements in background
-
Call-to-Action Buttons:
- Primary button with solid background
- Secondary button with outline
- Hover effects and transitions
-
Typography:
- Large, bold headline
- Clear supporting text
- Responsive font sizing
-
Wave Divider:
- SVG wave pattern at bottom
- Multiple layers for depth effect
- Pure CSS implementation
To use this hero block:
- Replace the placeholder graphic with your actual image or illustration
- Customize the colors by modifying the gradient classes (
from-indigo-900,via-purple-800,to-pink-700) - Adjust text content to match your brand
- Update button links and actions
- Modify the wave color by changing the
text-whiteclass on the SVG
The design includes:
- Mobile-first responsive approach
- Accessibility considerations (contrast ratios)
- Hover effects for interactivity
- Relative positioning for layered elements
- z-index management for proper stacking
You can customize sizes, colors, and content to match your specific branding requirements. The abstract graphic placeholder can be replaced with an actual image by replacing the
divwith animgtag.-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.