Ask any question about HTML here... and get an instant response.
How can I create a responsive layout without using CSS frameworks?
Asked on Oct 29, 2025
Answer
To create a responsive layout without using CSS frameworks, you can utilize HTML5 semantic elements and CSS media queries. This approach allows you to structure your content meaningfully and adapt the layout to different screen sizes.
<!-- BEGIN COPY / PASTE -->
<header>
<h1>My Website</h1>
</header>
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
<main>
<section>
<h2>Welcome</h2>
<p>This is a responsive layout example.</p>
</section>
</main>
<footer>
<p>© 2023 My Website</p>
</footer>
<!-- END COPY / PASTE -->Additional Comment:
- Use semantic elements like
<header>,<nav>,<main>, and<footer>to give structure and meaning to your layout. - Implement CSS media queries to adjust styles based on device width, ensuring the layout is responsive.
- Consider using CSS Flexbox or Grid for more complex layouts that require dynamic resizing and alignment.
✅ Answered with HTML best practices.
Recommended Links:
