<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Prajapatiankur on Medium]]></title>
        <description><![CDATA[Stories by Prajapatiankur on Medium]]></description>
        <link>https://medium.com/@prajapatiankur8349?source=rss-88755ed1e888------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*9YqTW8HjdCARP3-t</url>
            <title>Stories by Prajapatiankur on Medium</title>
            <link>https://medium.com/@prajapatiankur8349?source=rss-88755ed1e888------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 01:31:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@prajapatiankur8349/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Create Responsive Websites Like a Pro]]></title>
            <link>https://medium.com/@prajapatiankur8349/how-to-create-responsive-websites-like-a-pro-2193ff6ab574?source=rss-88755ed1e888------2</link>
            <guid isPermaLink="false">https://medium.com/p/2193ff6ab574</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[html-structure]]></category>
            <category><![CDATA[responsive]]></category>
            <dc:creator><![CDATA[Prajapatiankur]]></dc:creator>
            <pubDate>Tue, 03 Jun 2025 05:20:25 GMT</pubDate>
            <atom:updated>2025-06-03T05:20:25.463Z</atom:updated>
            <content:encoded><![CDATA[<p>In this post, let’s break down how to <strong>actually</strong> build fully responsive websites that don’t break the internet (or your codebase). No fluff, just the real dev wisdom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YM7ASnlltolir07KTRZ-nQ.jpeg" /></figure><h4>1. Start with Breakpoints in Mind</h4><p>Before you even touch your CSS, take a step back and study your design across <strong>all screen sizes</strong> — mobile, tablet, desktop, and large desktops.</p><p>Use a smart layout with nested containers so that adapting to screen sizes is as simple as changing flex-direction or grid-template-columns.</p><blockquote><em>50% of responsive design is just </em><strong><em>solid HTML structure</em></strong><em>.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v9j2PbzzkRiuVxyIT7QDxQ.png" /></figure><pre>&lt;!-- mobile first approach --&gt;<br>&lt;section class=&quot;some-section&quot;&gt;<br>    &lt;div class=&quot;top&quot;&gt;<br>        &lt;img<br>            src=&quot;hero.webp&quot;<br>            alt=&quot;hero image&quot;<br>        &gt;<br>    &lt;/div&gt;<br>    &lt;div class=&quot;bottom&quot;&gt;<br>        &lt;div class=&quot;left&quot;&gt;<br>            &lt;p&gt;some text&lt;/p&gt;<br>        &lt;/div&gt;<br>        &lt;div class=&quot;right&quot;&gt;<br>            &lt;h1&gt;some heading&lt;/h1&gt;<br>            &lt;p&gt;paragraph&lt;/p&gt;<br>        &lt;/div&gt;<br>    &lt;/div&gt;<br>&lt;/section&gt;</pre><h4>2. Always Use Mobile-First CSS</h4><p>Write your CSS for <strong>mobile first</strong>, then scale up using media queries.</p><p>It keeps the code clean and the UX solid for the majority of users who visit from phones.</p><pre>/* Mobile styles */<br>.example {<br>    font-size: 1rem;<br>}<br><br>/* Tablet styles */<br>@media (min-width: 768px) {<br>    .example {<br>        font-size: 1.25rem;<br>    }<br>}<br><br>/* Desktop styles */<br>@media (min-width: 1024px) {<br>    .example {<br>        font-size: 1.5rem;<br>    }<br>}</pre><h4>3. Use Responsive CSS Units (`rem`, `em`)</h4><p>Using px locks values to a fixed size, which breaks flexibility across devices and ignores user accessibility settings.</p><p>Instead, use rem, em, or % to make your design <strong>fluid</strong>, <strong>scalable</strong>, and <strong>responsive to browser settings</strong> like Zoom ( Ctrl + ) or custom font size.</p><pre>html {<br>  font-size: clamp(0.875rem, 1vw + 0.5rem, 1.125rem);<br>}<br><br>h1 {<br>  font-size: 2rem; /* Scales based on the root size */<br>}</pre><h4>4. Flexbox &amp; Grid</h4><p>Flexbox and CSS Grid are your best friends for building <strong>responsive layouts</strong>.</p><p>You can create stacked layouts for mobile and horizontal ones for bigger screens — without adding a ton of media queries.</p><pre>.responsive-section {<br>    display: flex;<br>    flex-direction: column;<br>}<br><br>@media (min-width: 768px) {<br>    .responsive-section {<br>        flex-direction: row;<br>    }<br>}</pre><h4>5. Use `clamp()` for Font Sizes</h4><p>This ensures that text stays comfortably readable on smaller screens, grows proportionally on tablets and desktops, and avoids becoming overwhelmingly large on 4K or ultra-wide displays. It’s the perfect balance between accessibility and aesthetics, making sure your typography adapts naturally while still respecting boundaries.</p><pre>html {<br>    font-size: clamp(0.875rem, 1vw + 0.5rem, 1.125rem);<br>}</pre><h4>6. Define CSS Variables (custom properties) for Reusability</h4><p>This approach centralizes your design tokens, making it easy to update a value in one place and have that change reflected across your entire site.</p><p>It also pairs beautifully with media queries — you can redefine variables at different breakpoints for fully responsive design without rewriting the entire CSS block. Plus, when working in a team or maintaining a large project, variables instantly improve readability and reduce bugs caused by inconsistent values.</p><pre>:root {<br>  --font-size-sm: 0.875rem;<br>  --font-size-md: 1rem;<br>  --border-radius-lg: 0.5rem;<br>}</pre><h4>7. Use Wrapper Sections for Centered Layouts</h4><p>When designing for large screens, it’s important to prevent your content from stretching edge-to-edge, which can make it harder to read and visually unbalanced.</p><p>To fix this, wrap your section content inside a container div (commonly called a “wrapper”) and apply a max-width along with margin: auto. This centers the content and restricts its width, ensuring it stays clean, readable, and aligned — especially on desktop and ultra-wide monitors.</p><pre>.wrapper {<br>  max-width: 1200px;<br>  margin: 0 auto;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FFBfTyKIUe18LFtYVO0fQQ.png" /></figure><p>It’s a small trick that makes a huge difference in your overall UI polish.</p><h4>8. Use Section Padding + Media Queries</h4><p>Consistent vertical spacing makes layouts clean and breathable. Use padding-top and padding-bottom for each section, and adjust them with media queries. Define values as CSS variables for easy updates across breakpoints</p><p>Just make sure your media queries are spaced logically — intervals of 150px to 200px work well in most cases</p><pre>@media (max-width: 800px) {<br>    section{<br>        --padding-top: 60px;<br>        --padding-bottom: 60px;<br>    }<br>}<br><br>@media (min-width: 800px) and (max-width: 1000px) {<br>    section{<br>        --padding-top: 100px;<br>        --padding-bottom: 100px;<br>    }<br>}<br><br>@media (min-width: 1000px) and (max-width: 1200px) {<br>    section{<br>        --padding-top: 150px;<br>        --padding-bottom: 100px;<br>    }<br>}<br><br>@media (min-width: 1200px){<br>    section{<br>        --padding-top: 200px;<br>        --padding-bottom: 150px;<br>    }<br>}</pre><h4>9. Don’t Be Scared of Media Queries</h4><p>Media queries are essential for building truly responsive designs. While too many can clutter your code, avoiding them limits flexibility. The key is to strike a balance — use them where they add real value, organize them cleanly, and combine them with techniques like flex, grid, and clamp() to minimize overuse. When used wisely, media queries help your UI feel tailored across all devices without becoming a maintenance nightmare.</p><h4>Final Thoughts</h4><p>Start mobile-first. Use fluid units. Embrace CSS grid/flex. Structure your HTML with intention.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2193ff6ab574" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>