<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Mobile-First Webpage</title> <style> /* Basic mobile styles */ body { font-family: Arial, sans-serif; margin: 0; padding: 0; background-color: #f4f4f4; } header { background-color: #333; color: #fff; padding: 10px; text-align: center; } nav { background-color: #555; color: #fff; text-align: center; padding: 10px; } nav a { color: #fff; text-decoration: none; margin: 0 10px; } section { padding: 20px; text-align: center; } footer { background-color: #333; color: #fff; text-align: center; padding: 10px; } /* Larger screens: tablet and above */ @media (min-width: 768px) { header { padding: 20px; } nav { text-align: left; padding: 20px; } section { max-width: 750px; margin: 0 auto; } } /* Larger screens: desktop and above */ @media (min-width: 1024px) { nav { padding: 30px; } section { max-width: 1000px; } } </style> </head> <body> <header> <h1>Welcome to My Mobile-First Webpage</h1> </header> <nav> <a href="#">Home</a> <a href="#">About</a> <a href="#">Services</a> <a href="#">Contact</a> </nav> <section> <h2>About Us</h2> <p>We are a mobile-first company focused on providing great content and services!</p> </section> <footer> <p>© 2024 Mobile-First Webpage</p> </footer> </body> </html>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter