
A footer is often the last thing a visitor sees, and it is usually where people look for contact details, a short set of links, and a reason to trust the site. If it breaks, overlaps, or hides those details on a phone, the rest of the page feels unfinished. Building a footer that holds together from a wide desktop down to a small screen is mostly a matter of planning the content, using straightforward HTML, and letting CSS rearrange the layout at a few well-chosen widths.
Decide what belongs in the footer before you write any markup
Most useful footers include a short description of the site or business, a group of navigation links, contact information, social links, and a copyright line at the bottom. Some also add a newsletter field, a small map, or links to a privacy policy and terms of service. Put in what visitors actually need, and leave out anything that only adds clutter.
Sketch the layout, even if that is only a quick paper grouping. A common desktop pattern is three or four columns, each holding a related set of links such as About, Services, Support, and Contact. Someone looking for help can then go straight to Support instead of reading every link. Keep each column short, ideally no more than five or six links; a long list is hard to scan and pushes the footer taller than it needs to be. Planning first also makes the HTML simpler, because you already know how many sections you need.
Start with semantic HTML
Use the footer element itself. Inside it, add a container that holds the content and limits its width, so the block does not stretch awkwardly on a very wide screen. Give each column its own div and a clear class name, such as footer-about, footer-links, or footer-contact, so the CSS can target them without guesswork.
Headings inside those columns should use h3 or h4, depending on the heading structure of the rest of the page. Link lists belong in ul and li elements, not a run of unconnected anchors. Contact details can live in ordinary paragraphs, with an address tag if you are including a physical address. Social links should be ordinary anchors with descriptive text for screen readers, not vague labels. At the bottom, put the copyright bar in its own div, with the year, the site name, and links to legal pages. Clean markup is easier to style, easier to maintain, and easier for assistive tools to interpret.
Style the footer so the columns share the width
A background colour that contrasts with the main content, often a dark shade, plus text that stays readable against it, is a solid starting point. Give the footer generous padding, commonly around forty to sixty pixels at the top and bottom, and a comfortable line height. Links need a clear colour and a hover state, such as a lighter colour or an underline, so they read as clickable.
Flexbox is a practical way to arrange the columns, because spacing and alignment take very little code. Set the container to display: flex, use justify-content: space-between, add a gap between columns, and give each column a flexible width so they share the space. flex-wrap can let columns wrap on smaller screens, though a media query usually gives you more control. Keep fixed heights off the footer. The content has to be free to grow when a line wraps or one column holds more links than the others. CSS Grid is a reasonable alternative when the columns are uneven or the footer has more than one row; Flexbox is often enough for a single row of equal columns.
Make the layout respond at real breakpoints
A desktop footer can collapse on a phone if you never adjust it. Design the wide layout first, then add media queries as the width narrows.
- Around 768 pixels, which covers most tablets and large phones, switch the flex direction from row to column, or go from four columns to two, depending on how much content you have. That keeps the footer readable without sideways scrolling.
- Around 480 pixels, stack the columns fully so each one takes the width of the screen. Increase the space between sections slightly so the blocks do not run together.
- Make links large enough to tap, with at least forty pixels of height, and check that headings are not oversized and that paragraphs do not shrink into a narrow, hard-to-read strip.
On a desktop, three or four columns is the range that usually looks balanced. More than four can feel crowded; one or two can leave a wide screen looking sparse. Avoid setting a fixed height, and give the footer enough padding so stacked sections still have room to breathe. Then resize the browser and, if you can, check a real phone. Long email addresses that overflow their container, or a row of social icons that wrap awkwardly, are the kind of problem that only shows up in a live window. Confirm that long words and links wrap instead of spilling out of their column.
Finishing details that help, and ones that get in the way
A newsletter form, with a single email field and a clearly visible button, can sit in one column if it does not dominate the footer. A long form down there is unlikely to be completed. Social icons help only when they are recognisable, labelled for screen readers, and pointed at profiles that are actually maintained.
A thin top border can separate the footer from the content above. The copyright bar often looks clearer with a slightly lighter background. A back-to-top link is useful on long pages, and a one-line note about the site can add a bit of warmth. Stop before the footer becomes a second page of its own. Every extra element competes for attention.
Test appearance, browsers, and accessibility together
Check the footer in more than one browser. Older browsers can handle flexbox and media queries differently. Look at it with images and custom fonts disabled, to make sure the structure still holds. Typical failures include text that is too light against the background, links that sit too close together to tap, and columns that overlap when the window is resized. Browser developer tools let you inspect the layout, simulate widths, and see which rule is causing the problem.
Accessibility deserves the same attention as appearance. Colour contrast between text and background should meet the usual recommended standard. Links need meaningful text rather than a bare instruction to click. The footer should be usable with a keyboard alone. Use proper heading levels, add labels or alternative text to icons, and do not rely on colour alone to carry meaning. A footer that passes those checks is easier for everyone to use, including people on a small screen, in bright light, or on a slow connection. Once it does, you have a component you can reuse and adapt.
What belongs on the copyright line
The copyright bar usually carries the copyright symbol, the year, the site or company name, and links to the privacy policy and terms of service. Keep it short and park it at the very bottom of the footer. It is the quiet end of the page, not another column of marketing.
