
Modern digital world, users access websites using different devices like mobile phones, tablets, laptops, and desktop computers. If your website looks perfect on a laptop but breaks on mobile screens, you lose visitors quickly. That’s why responsive web design is no longer optional—it’s a must.
A responsive web page automatically adjusts its layout, images, and content based on the user’s screen size and device. The best part is: you can build a responsive layout using pure CSS without depending heavily on frameworks.
How to Make a Website Responsive?
Responsive web design is an approach where a website layout adapts smoothly to different screen sizes and orientations. A responsive page:
- Fits mobile screens without zooming
- Adjusts spacing, fonts, and alignment automatically
- Keeps content readable and accessible
- Improves user experience and engagement
- Supports SEO better (search engines prefer mobile-friendly websites)
If your users can comfortably navigate your website on a phone, they are more likely to stay longer, interact, and return.
How to Create Responsive Website Without Bootstrap?
HTML creates the structure of the page, but CSS controls layout and styling. With modern CSS features, you can handle responsiveness efficiently using:
- Fluid layouts (%, vw, flex units)
- Flexible images
- Media queries
- Flexbox and CSS Grid
- Responsive typography
01. Use Right Meta Viewport (Important)
Before you even start CSS, make sure your HTML contains the viewport tag. Without it, mobile browsers display your site in a “desktop view” and scale it down, ruining responsiveness.
Add this inside <head>:
1<meta name="viewport" content="width=device-width, initial-scale=1.0">
This tells the browser:
- Use the device screen width
- Scale content correctly
02. Build Layout Using Fluid Units Instead of Fixed Pixels
Many beginners make a common mistake: using fixed widths like width: 1200px;. This works on one screen but fails on others.
Instead, use flexible units:
Common Responsive Units
- % → Relative to parent container
- vw → Relative to viewport width
- vh → Relative to viewport height
- rem → Relative to root font-size
- em → Relative to parent font-size
Example:
1.container {2 width: 90%;3 max-width: 1200px;4 margin: auto;5}
This makes the container:
- 90% width on small screens
- Never exceed 1200px on big screens
03. Make Images Responsive (Very Important)
Fixed-size images can break the layout, especially on mobile.
Always use:
1img {2 max-width: 100%;3 height: auto;4 display: block;5}
This ensures:
- Image never goes outside its container
- Aspect ratio remains perfect
- No unnecessary scrolling
04. Use Flexbox for Responsive Layouts
Flexbox is one of the best tools to create responsive sections like:
- Navigation bars
- Feature cards
- Content + sidebar
- Services section
Example: Responsive Card Layout Using Flexbox
1<div class="cards">2 <div class="card">Card 1</div>3 <div class="card">Card 2</div>4 <div class="card">Card 3</div>5</div>
1.cards {2 display: flex;3 gap: 20px;4 flex-wrap: wrap;5}67.card {8 flex: 1 1 250px;9 padding: 20px;10 border: 1px solid #ddd;11}
Explanation:
- flex-wrap: wrap; allows items to move to the next line on smaller screens
- flex: 1 1 250px; means each card will try to stay 250px minimum, then adjust
This is exactly how professional responsive websites are built.
05. Use CSS Grid for Advanced Responsiveness
CSS Grid is best for complete page layouts such as:
- Homepage layout
- Dashboard layout
- Blog layout with sidebar
Example Grid Layout:
1.layout {2 display: grid;3 grid-template-columns: 2fr 1fr;4 gap: 20px;5}
This means:
- Main content = 2 parts
- Sidebar = 1 part
Now for mobile responsiveness:
1@media (max-width: 768px) {2 .layout {3 grid-template-columns: 1fr;4 }5}
So sidebar goes below content on smaller screens automatically.
06. Media Queries (Backbone of Responsive CSS)
Media queries allow you to apply CSS only when screen conditions match.
Basic Structure
1@media (max-width: 600px) {2 /* mobile styles here */3}4
Common Responsive Breakpoints:
You don’t need too many breakpoints. Keep it clean.
- 1200px → Large laptops
- 992px → Small laptops/tablets landscape
- 768px → Tablets
- 600px → Large phones
- 480px → Small phones
Example:
1h1 {2 font-size: 42px;3}45@media (max-width: 768px) {6 h1 {7 font-size: 32px;8 }9}1011@media (max-width: 480px) {12 h1 {13 font-size: 26px;14 }15}
This improves readability and makes your design look professional.
07. Responsive Navigation Menu
Most websites fail at navigation responsiveness. On small screens, menu items overflow. A simple approach:
- Use Flexbox
- Wrap menu items
- Reduce spacing on smaller screens
Example:
1.navbar {2 display: flex;3 justify-content: space-between;4 align-items: center;5 padding: 15px;6}78.nav-links {9 display: flex;10 gap: 20px;11}1213@media (max-width: 600px) {14 .nav-links {15 flex-direction: column;16 gap: 10px;17 }18}
For advanced design, you can implement a hamburger menu later using JavaScript, but the CSS concept remains the same.
08. Responsive Typography (Fonts That Adapt)
Text that looks good on desktop may feel too large or too small on mobile.
A modern professional approach:
1body {2 font-size: clamp(16px, 2vw, 18px);3}
Meaning:
- Minimum 16px
- Scales with viewport
- Maximum 18px
For headings:
1h1 {2 font-size: clamp(28px, 4vw, 48px);3}
This makes typography responsive without extra media queries.
09. Use Mobile-First CSS Approach
Instead of designing desktop first and then fixing mobile, professionals use mobile-first design.
Mobile-first means:
- Write base CSS for mobile first
- Add media queries for bigger screens
Example:
1.card {2 padding: 15px;3 font-size: 16px;4}56/* For tablets and desktops */7@media (min-width: 768px) {8 .card {9 padding: 25px;10 font-size: 18px;11 }12}
Mobile-first design results in:
- Faster loading
- Better user experience
- Cleaner code
10. Common Mistakes to Avoid
To make your responsive web page truly professional, avoid these mistakes:
i. Using fixed widths everywhere
Bad:
1width: 1000px;
Good:
1width: 100%;2max-width: 1000px;
ii. Forgetting responsive images
If image widths are fixed, layout will overflow.
iii. Too many breakpoints
Only add breakpoints when layout actually breaks.
iv. Ignoring padding and spacing on mobile
Mobile needs comfortable spacing.
v. Not testing on real devices
Always test using:
- Chrome DevTools responsive mode
- Actual phone browser
Conclusion - Create a Responsive Web Page in CSS
Building a responsive web page in CSS is not difficult if you follow the right approach. You don’t need heavy frameworks to create modern responsive layouts. With proper use of:
- Fluid units
- Flexbox
- CSS Grid
- Media queries
- Mobile-first design
You can design pages that look clean and professional on every device. If you master responsive CSS, your website will keep visitors engaged longer, improve your blog’s reputation, and make users want to explore your next posts.





