Build a website layout by starting with semantic HTML and normal flow, then choosing CSS for the relationship between elements: use Grid for page regions and card collections, and Flexbox for one-dimensional arrangements such as navigation and card content. Add columns when the content has room to fit, not simply because a particular device is common.
Start with meaningful HTML and normal flow
Before adding layout rules, put the content in a sensible reading order using elements such as <header>, <nav>, <main>, <aside>, and <footer>. In normal flow, block content proceeds in the block direction, while inline content runs along a line and wraps as needed. This gives the page a readable baseline before CSS rearranges it. MDN describes a well-structured document readable in normal flow as the best starting point for a webpage: Introduction to CSS layout.
Use layout CSS to improve the presentation without making the source order confusing. A reader, browser, or assistive technology should still encounter the content in a meaningful sequence if the layout changes or the CSS is unavailable.
Choose Grid or Flexbox by the relationship you need
| Question | Use Grid when… | Use Flexbox when… |
|---|---|---|
| How many dimensions matter? | You need to coordinate rows and columns together, such as a page shell or card collection. | You are arranging items along one axis, a row or a column. |
| How explicit is placement? | You want to describe a two-dimensional map or define tracks for repeated items. | You want items to share available space, wrap, or align along one direction. |
| What is the typical use here? | Header, navigation, main content, optional sidebar, footer; or a grid of cards. | Links in a navigation row; content and an action arranged inside a card. |
These methods work together rather than competing. Grid can position the major regions of a page while Flexbox handles the items within one of those regions. See MDN’s guides to CSS grid layout and Flexbox.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Build a responsive page shell with Grid
Named grid areas make a page shell readable as a map. This example keeps a single-column structure at narrower widths, then places the sidebar beside the main content when there is enough room. The breakpoint is an example; choose a threshold by checking when your actual content fits well.
<div class="site-layout">
<header class="site-header">Site title</header>
<nav class="site-nav" aria-label="Main navigation">
<a href="/">Home</a>
<a href="/guides">Guides</a>
<a href="/about">About</a>
</nav>
<main class="site-main">
<h1>Page title</h1>
<p>Main page content goes here.</p>
</main>
<aside class="site-sidebar">Related links</aside>
<footer class="site-footer">Footer content</footer>
</div>
* {
box-sizing: border-box;
}
.site-layout {
display: grid;
grid-template-areas:
"header"
"nav"
"main"
"sidebar"
"footer";
gap: 1rem;
max-width: 72rem;
margin-inline: auto;
padding: 1rem;
}
.site-header { grid-area: header; }
.site-nav { grid-area: nav; }
.site-main { grid-area: main; }
.site-sidebar { grid-area: sidebar; }
.site-footer { grid-area: footer; }
@media (min-width: 50rem) {
.site-layout {
grid-template-columns: minmax(0, 2fr) minmax(14rem, 1fr);
grid-template-areas:
"header header"
"nav nav"
"main sidebar"
"footer footer";
}
}
The minmax(0, 2fr) main track can shrink within the available grid space, while the sidebar has a minimum track size. Adjust those values to suit your content and available width; if the sidebar becomes cramped, keep the one-column arrangement longer or revise the column proportions. MDN demonstrates named areas for common responsive shells in Realizing common layouts using grids.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Arrange navigation with Flexbox
A navigation list is a one-dimensional set of links, so Flexbox is a natural fit. The following markup is already included in the shell above; apply these rules to space links and let them wrap if the available width is limited.
.site-nav {
display: flex;
flex-wrap: wrap;
gap: 0.75rem 1.25rem;
align-items: center;
}
.site-nav a {
display: inline-block;
}
Use gap to create consistent spacing without adding margins to individual links. If the navigation must fit a narrow screen, wrapping is preferable to forcing links into a row that overflows. Flexbox’s central model is arranging items along one dimension, as explained in MDN’s Flexbox guide.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Create a card collection that adapts to available width
For repeated cards, Grid can create as many columns as fit a flexible minimum width. The browser places each card into the next available grid cell. A card itself can use Flexbox in a column so its content and action remain arranged vertically.
<section class="cards" aria-label="Guides">
<article class="card">
<h2>Guide one</h2>
<p>A short description of the guide.</p>
<a href="/guide-one">Read the guide</a>
</article>
<article class="card">
<h2>Guide two</h2>
<p>Another short description.</p>
<a href="/guide-two">Read the guide</a>
</article>
<article class="card">
<h2>Guide three</h2>
<p>More useful information for readers.</p>
<a href="/guide-three">Read the guide</a>
</article>
</section>
.cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
gap: 1rem;
}
.card {
display: flex;
flex-direction: column;
gap: 0.75rem;
padding: 1rem;
border: 1px solid #ccc;
}
.card p {
margin-block: 0;
}
.card a {
align-self: flex-start;
margin-top: auto;
}
minmax() sets a flexible track with a preferred minimum, and auto-fit lets the grid accommodate the number of columns that fit. The inner min(100%, 16rem) avoids demanding a minimum wider than the container itself. Adjust the preferred card width to match the design and content. MDN covers auto-placement and flexible tracks in its common grid layouts guide.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Make responsive decisions around content fit
Begin with the narrow arrangement, then add columns or change the grid map when the content has enough room. A breakpoint should solve an observable problem: for example, a main column becoming too narrow beside a sidebar, or a row of cards becoming awkwardly compressed. Check actual text lengths, navigation labels, and card widths as the viewport changes.
- Build the single-column layout and confirm the source order reads naturally.
- Resize the viewport gradually and note where content begins to feel crowded or excessively sparse.
- Add a media query at the point where an alternate arrangement improves readability and fit.
- Check the transition around that width, not only at a few named device sizes; revise the columns or threshold if content overflows.
Flexible grids and content-driven breakpoints are core responsive design techniques. MDN’s Responsive web design guide discusses starting with a simple narrow layout and adding complexity as space permits. Example values in tutorials are demonstrations, not universal device thresholds.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesBest Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Use positioning and floats only for their specific jobs
Positioning for controlled placement and overlap
Absolute positioning is useful for an element placed relative to a containing block, such as a badge over an image. Fixed positioning can keep an interface element attached to the viewport. These choices remove the positioned box from ordinary flow, so surrounding content does not reserve its usual space. Plan for overlap, obscured content, and the need to keep important material reachable.
.image-wrap {
position: relative;
}
.image-badge {
position: absolute;
inset-block-start: 0.75rem;
inset-inline-end: 0.75rem;
}
Here the wrapper establishes the positioning context for the badge. Do not use absolute or fixed positioning as a substitute for arranging the ordinary regions of a page. See MDN’s positioning guide for how positioned boxes relate to normal flow.
Floats for text wrapping around an item
A float is appropriate when text should wrap alongside an item, such as a small image within an article paragraph. It is not the general tool for building a modern sidebar-and-main layout.
.article-image {
float: inline-start;
max-width: 12rem;
margin: 0 1rem 0.75rem 0;
}
Use a layout system such as Grid or Flexbox for page regions; reserve floats for the text-wrapping relationship they were designed to provide. MDN outlines the roles of current CSS layout methods in CSS layout.
Or skip the browser setup
If you need a rendered screenshot of a page after building its layout, ScreenshotNeo can return an image or PDF from one GET request. For example, using cURL:
Quick Recap
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
See the ScreenshotNeo documentation for request options. ScreenshotNeo accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed. Its MCP server provides screenshot tools for AI agents, and the free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots. Learn about ScreenshotNeo, or sign up for 1,000 free screenshots a month with no card.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

