Skip to content

Simple Centered Footer

Minimal centered footer in pure CSS with a logo, tagline, links with animated underlines, round icon links and an auto-updating copyright year.

Live preview

Open in new tab

Code

A minimal centered footer built with pure CSS and a tiny bit of vanilla JavaScript. It stacks a logo, a short tagline, a row of footer links, round contact icons and a copyright line on a warm cream background, which makes it a good fit for portfolios, small business sites, blogs and landing pages.

How it works

The root footer.cf-footer sets every color as a custom property and centers its content with text-align: center. Inside, .cf-inner limits the width with --cf-max. The .cf-brand link holds an inline SVG .cf-logo (a filled circle with a monogram) and the .cf-name set in a serif font. Below the .cf-tagline, a nav.cf-nav contains the ul.cf-links list; it uses flexbox with flex-wrap, so the links wrap onto two centered rows on narrow phones.

Each .cf-link has an ::after underline that is scaled to zero with transform: scaleX(0) and grows from the middle to full width on hover and keyboard focus. The ul.cf-social row holds four round .cf-icon links with stroke icons that fill with the accent color and lift slightly on hover. A short hr.cf-rule separates the copyright line, .cf-copy, which stacks the text and the .cf-legal links on phones and puts them side by side from 560px.

The script finds every .cf-footer on DOMContentLoaded and writes the current year into each element with data-cf-year. Without JavaScript the year written in the markup is shown.

Customization

  • --cf-accent on .cf-footer: changes the top border, the logo circle, the link underline, the hover color and the focus outline.
  • --cf-bg, --cf-text and --cf-muted: set the background and text colors; use a dark --cf-bg with light text for a dark footer.
  • --cf-icon-bg: the resting background of the round .cf-icon buttons.
  • --cf-max: the maximum width of .cf-inner; raise it if you add more links.
  • gap: 0.25rem 1.5rem in .cf-links: controls the row and column spacing between the footer links.
  • Remove the border-top from .cf-footer for a borderless footer that blends into the page.
  • Replace the .cf-logo SVG and the .cf-name text with your own brand mark.

Accessibility

The links sit in a nav landmark labelled "Footer", and the icon list has aria-label="Social media". Every icon-only link has its own aria-label, while the SVGs are aria-hidden and not focusable. The brand link is labelled as the home link. All interactive elements show a 3px :focus-visible outline in the accent color, the icon links are 44px touch targets, and the text colors keep readable contrast on the cream background. With prefers-reduced-motion: reduce the underline animation and the hover lift are switched off.

Usage notes

Place the footer at the end of your page body. Several instances can share a page; the script updates the year in each one.

Requirements

No dependencies. Pure HTML, CSS and JavaScript.

Simple Centered Footer – Pure CSS footers component screenshot
Simple Centered Footer · Pure CSS Footers

More Footers

Dark Footer with App Badges – Tailwind CSS footers preview

Dark Footer with App Badges

Dark Tailwind CSS footer with four link columns, App Store and Google Play badges, and a language select that remembers the choice.

Footer with Newsletter – Bootstrap 5 footers preview

Footer with Newsletter

Dark Bootstrap 5 footer with a newsletter signup panel, email validation, social icons, three link columns and a legal bar.

Multi-Column Footer – Tailwind CSS footers preview

Multi-Column Footer

Dark Tailwind CSS website footer with brand block, social icons, four labelled link columns and a bottom bar with copyright and status.