CHROMATIC-SYSTEM v1.03_SIMPLE_FIXED_FOOTER_ENGINE

INFORMATION & CODE

Simple Fixed Footer

What It Does

The provided code creates a fixed, modern, and responsive website footer that "floats" at the bottom of the screen as the user scrolls. It acts as a comprehensive site-navigation and branding panel, packed with standard footer elements including internal links (Home, Contact, Menu), legal links (Terms & Conditions, Privacy Policy, Cookie Policy), social media share buttons powered by FontAwesome, a copyright notice, and a company logo. Additionally, the CSS includes responsive media queries so that the layout gracefully adapts and rearranges itself for smaller mobile screens.

How It Works

The code is divided into two main parts: the structural HTML markup and the styling/layout CSS.

  • HTML Structure: The HTML document loads essential external resources in the <head>, including Google Fonts and external libraries for jQuery and FontAwesome (which provides the icons for the social media buttons). Inside the <body>, a semantic <footer> element wraps all the footer contents. This container is split into an inner grid (.footer-inner) containing navigation links and social buttons, followed by a copyright span and a hosted company logo image.
  • CSS Styling & Layout:
    • Fixed Positioning: The <footer> uses position:fixed combined with bottom: 40px and a high z-index: 9999. This ensures the footer floats 40 pixels above the bottom of the browser window and stays on top of all other page content.
    • Grid System: The .footer-inner container utilizes CSS Grid (display: grid) with three columns (1fr 1fr 2fr) to organize the navigation boxes and social media sharing box neatly side-by-side.
    • Interactivity: The social media buttons (.share-btn) feature hover and active pseudo-classes (:hover and :active). When hovered, they display a soft shadow, and when clicked, they simulate a physical button press by shifting downward (transform: translatey(+4px)).
    • Responsiveness: A @media query triggers when the screen width drops to 780 pixels or less. It dynamically adjusts font sizes, tightens margins, shrinks the logo, and repositions the logo to the horizontal center of the footer to prevent overlapping on mobile devices.

How to Use It

To use this code on your own website, follow these steps:

  1. Combine the Code: Create an HTML file (e.g., index.html) and paste the HTML snippet inside the <body> tags. Make sure to include the <head> contents in your document's <head> section so that the FontAwesome icons and jQuery load correctly.
  2. Add the CSS: Wrap the provided CSS code inside <style> ... </style> tags within your HTML's <head>, or paste it directly into an external stylesheet (e.g., style.css) and link it to your HTML file using <link rel="stylesheet" href="style.css">.
  3. Customize the Content:
    • Replace the # in the href="#" attributes with your actual webpage URLs (e.g., href="contact.html").
    • Update the copyright text (© example co September 2022) to match your company name and current year.
    • Change the image source (src="...") in the <img> tag to point to your own company logo.
  4. Test the Layout: Open the HTML file in any web browser. Scroll up and down to see the fixed floating footer in action, and resize your browser window to test the responsive mobile layout.

HTML

CSS