Preview:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Mobile First Approach</title>
    <style>
        body, h1, h2, p, ul {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            color: #333;
            padding: 20px;
        }

        header {
            background-color: #007bff;
            color: white;
            padding: 15px;
            text-align: center;
        }

        header h1 {
            font-size: 1.8rem;
        }

        nav {
            background-color: #333;
            padding: 10px;
            text-align: center;
        }

        nav ul {
            list-style-type: none;
        }

        nav ul li {
            display: inline;
            margin: 0 15px;
        }

        nav ul li a {
            color: white;
            text-decoration: none;
            font-weight: bold;
            font-size: 1.1rem;
        }

        nav ul li a:hover {
            color: #ffcc00;
        }

        main {
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            margin-top: 20px;
        }

        main h2 {
            font-size: 1.6rem;
            margin-bottom: 10px;
        }

        main p {
            font-size: 1rem;
            color: #555;
            line-height: 1.6;
        }

        footer {
            text-align: center;
            padding: 10px;
            background-color: #333;
            color: white;
            margin-top: 20px;
        }

   
        @media(min-width: 768px) {
            header h1 {
                font-size: 2.5rem;
            }

            nav ul li {
                margin: 0 25px;
            }

            main h2 {
                font-size: 2rem;
            }

            footer {
                font-size: 1.2rem;
            }
        }

     
        @media(min-width: 1024px) {
            body {
                max-width: 960px;
                margin: 0 auto;
            }

            main {
                padding: 40px;
            }
        }
    </style>
</head>
<body>

    <header>
        <h1>Welcome to Our Website</h1>
    </header>

    <nav>
        <ul>
            <li><a href="#home">Home</a></li>
            <li><a href="#about">About</a></li>
            <li><a href="#services">Services</a></li>
            <li><a href="#contact">Contact</a></li>
        </ul>
    </nav>

    <main>
        <section id="home">
            <h2>Home</h2>
            <p>Welcome to our mobile-first website!</p>
        </section>

        <section id="about">
            <h2>About Us</h2>
            <p>We offer high-quality services to help your business grow.</p>
        </section>

        <section id="services">
            <h2>Our Services</h2>
            <ul>
                <li>Web Design</li>
                <li>Development</li>
                <li>SEO</li>
                <li>Marketing</li>
            </ul>
        </section>
    </main>

    <footer>
        <p>&copy; 2024 Company Name. All Rights Reserved.</p>
    </footer>

</body>
</html>
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