Css header footer example

Содержание
  1. CSS Website Layout
  2. Header
  3. Example
  4. Header
  5. Navigation Bar
  6. Example
  7. Content
  8. Example
  9. Column
  10. Column
  11. Column
  12. Unequal Columns
  13. Example
  14. Side
  15. Main Content
  16. Side
  17. Footer
  18. Example
  19. Responsive Website Layout
  20. 64 CSS Headers and Footers
  21. Table of Contents
  22. Related Articles
  23. Article Headers
  24. Author
  25. Links
  26. Made with
  27. About the code
  28. Non Rectangular Headers
  29. Author
  30. Links
  31. Made with
  32. About the code
  33. Curve Header
  34. Author
  35. Links
  36. Made with
  37. About the code
  38. Header Image Parallax Scrolling Effect with CSS
  39. Author
  40. Links
  41. Made with
  42. About the code
  43. Fixed Angled Header
  44. Author
  45. Links
  46. Made with
  47. About the code
  48. Skewed Header
  49. Author
  50. Links
  51. Made with
  52. About the code
  53. Curve SVG Background Animation
  54. CSS Animated Header
  55. Slanted Div, Fixed Header
  56. CSS Header
  57. Multi-Layered Parallax Illustration
  58. Hero Idea
  59. Headings/Hero Image Typography Playground
  60. Hero Zoom On Scroll
  61. Neat Parallax Hero Effect
  62. Fixed Post Header
  63. CSS Parallax Header Image
  64. Fullscreen Headers
  65. Author
  66. Links
  67. Made with
  68. About the code
  69. Hover Effect for Headers
  70. Author
  71. Links
  72. Made with
  73. About the code
  74. Header / About Page
  75. Author
  76. Links
  77. Made with
  78. About the code
  79. Header for Landing Page
  80. Author
  81. Links
  82. Made with
  83. About the code
  84. Sexy Animated Rainbow Waves Header
  85. Hero Image Showcase
  86. Hero Effect–Magazine
  87. Flexbox Hero Header
  88. Simple Parallax Header
  89. Hero OnScroll
  90. Fullscreen Header With Background Color Cycle
  91. Continuous Scrolling Background Of Sticky Header
  92. Fixed (Sticky) Headers
  93. Author
  94. Links
  95. Made with
  96. About a code
  97. Blurry Header
  98. Author
  99. Links
  100. Made with
  101. About a code
  102. Just A Simple Header Bar
  103. Author
  104. Links
  105. Made with
  106. About the code
  107. Sticky Headers
  108. Author
  109. Links
  110. Made with
  111. About the code
  112. Sticky Header On Scroll
  113. Responsive Scrolling Sticky Header
  114. Scroll Header
  115. Responsive Scroll Header
  116. Animate Header In/Out After Scrolling
  117. Header Fade
  118. Fixed Header Scroll Effect And Smart Nav For One-Page Sites
  119. Auto Hide Sticky Header
  120. Sticky Header CSS Transition
  121. Top Sliding Nav
  122. Responsive Sticky Header Navigation
  123. Fixed Header (Quick Hack)
  124. Sticky Header Visual Trick
  125. Video Headers
  126. React Video Header
  127. Video Header
  128. Hero Video
  129. Fullscreen Background Video With Mix-Blend-Mode Overlay Text
  130. Video Header Animation
  131. Responsive Video Header
Читайте также:  Html table css примеры

CSS Website Layout

A website is often divided into headers, menus, content and a footer:

There are tons of different layout designs to choose from. However, the structure above, is one of the most common, and we will take a closer look at it in this tutorial.

A header is usually located at the top of the website (or right below a top navigation menu). It often contains a logo or the website name:

Example

Header

A navigation bar contains a list of links to help visitors navigating through your website:

Example

/* The navbar container */
.topnav overflow: hidden;
background-color: #333;
>

/* Navbar links */
.topnav a float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
>

/* Links — change color on hover */
.topnav a:hover background-color: #ddd;
color: black;
>

Content

The layout in this section, often depends on the target users. The most common layout is one (or combining them) of the following:

  • 1-column (often used for mobile browsers)
  • 2-column (often used for tablets and laptops)
  • 3-column layout (only used for desktops)

We will create a 3-column layout, and change it to a 1-column layout on smaller screens:

Example

/* Create three equal columns that float next to each other */
.column float: left;
width: 33.33%;
>

/* Clear floats after the columns */
.row:after content: «»;
display: table;
clear: both;
>

/* Responsive layout — makes the three columns stack on top of each other instead of next to each other on smaller screens (600px wide or less) */
@media screen and (max-width: 600px) .column width: 100%;
>
>

Column

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sit amet pretium urna. Vivamus venenatis velit nec neque ultricies, eget elementum magna tristique.

Column

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sit amet pretium urna. Vivamus venenatis velit nec neque ultricies, eget elementum magna tristique.

Column

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sit amet pretium urna. Vivamus venenatis velit nec neque ultricies, eget elementum magna tristique.

Tip: To create a 2-column layout, change the width to 50%. To create a 4-column layout, use 25%, etc.

Tip: Do you wonder how the @media rule works? Read more about it in our CSS Media Queries chapter.

Tip: A more modern way of creating column layouts, is to use CSS Flexbox. However, it is not supported in Internet Explorer 10 and earlier versions. If you require IE6-10 support, use floats (as shown above).

To learn more about the Flexible Box Layout Module, read our CSS Flexbox chapter.

Unequal Columns

The main content is the biggest and the most important part of your site.

It is common with unequal column widths, so that most of the space is reserved for the main content. The side content (if any) is often used as an alternative navigation or to specify information relevant to the main content. Change the widths as you like, only remember that it should add up to 100% in total:

Example

/* Left and right column */
.column.side width: 25%;
>

/* Middle column */
.column.middle width: 50%;
>

/* Responsive layout — makes the three columns stack on top of each other instead of next to each other */
@media screen and (max-width: 600px) .column.side, .column.middle width: 100%;
>
>

Side

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Main Content

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sit amet pretium urna. Vivamus venenatis velit nec neque ultricies, eget elementum magna tristique. Quisque vehicula, risus eget aliquam placerat, purus leo tincidunt eros, eget luctus quam orci in velit. Praesent scelerisque tortor sed accumsan convallis.

Side

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

The footer is placed at the bottom of your page. It often contains information like copyright and contact info:

Example

Responsive Website Layout

By using some of the CSS code above, we have created a responsive website layout, which varies between two columns and full-width columns depending on screen width:

Ever heard about W3Schools Spaces? Here you can create your website from scratch or use a template, and host it for free.

Источник

64 CSS Headers and Footers

Collection of free HTML/CSS header and footer code examples: sticky, fixed, etc. Update of April 2019 collection. 5 new items.

Table of Contents

Article Headers

Demo image: Non Rectangular Headers

Author

Made with

About the code

Non Rectangular Headers

Non-Rectangular header with inline SVG.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: Curve Header

Author

Made with

About the code

Curve Header

Demo image: Header Image Parallax Scrolling Effect with CSS

Author

Made with

About the code

Header Image Parallax Scrolling Effect with CSS

Create a parallax scrolling effect using CSS background-image position. This script works when the header image is positioned at the top of the page.

Demo image: Fixed Angled Header

Author

Made with

About the code

Fixed Angled Header

This pen shows how CSS pseudo-elements and transforms can be used to create a fixed, angled header with an image background.

Demo image: Skewed Header

Author

Made with

About the code

Skewed Header

Skewed header with HTML and CSS.

Demo image: Curve SVG Background Animation

Author

Made with

About the code

Curve SVG Background Animation

Curve SVG background animation for header.

Demo Image: CSS Animated Header

CSS Animated Header

Animated blog header background image, no JavaScript.
Made by Nodws
May 30, 2017

Demo Image: Slanted Div, Fixed Header

Slanted Div, Fixed Header

Skewed divs and parallax effect created by fixed header. Simple layout and instructions for modification in the JS!
Made by Andrew Bales
January 10, 2017

Demo Image: CSS Header

CSS Header

HTML and CSS fixed disappearing scrolling header.
Made by Dudley Storey
December 3, 2016

Demo Image: Multi-layered Parallax Illustration

Multi-Layered Parallax Illustration

HTML, CSS and JavaScript multi-layered parallax illustration.
Made by Patryk Zabielski
April 27, 2016

Demo Image: Hero Idea

Hero Idea

Hero idea in HTML, CSS and JavaScript.
Made by Jake Lundberg
April 6, 2016

Demo Image: Headings/Hero Image Typography Playground

Headings/Hero Image Typography Playground

Explanation is at the top of CSS file. Just some typefaces, helper classes and few presets for easily testing headings typography.
Made by Mirko Zorić
March 18, 2016

Demo Image: Hero Zoom On Scroll

Hero Zoom On Scroll

Simple zoom effect using window scroll to adjust some CSS.
Made by Derek Palladino
October 8, 2015

Demo Image: Neat Parallax Hero Effect

Neat Parallax Hero Effect

Some JavaScript magic to make this nifty little parallax hero.
Made by Dominic Magnifico
September 22, 2015

Demo Image: Fixed Post Header

Fixed Post Header

Fixed header for each post with HTML, CSS and JavaScript.
Made by White Wolf Wizard
August 5, 2015

Demo Image: CSS Parallax Header Image

CSS Parallax Header Image

HTML and CSS parallax header image.
Made by Bennett Feely
November 18, 2014

Fullscreen Headers

Author

Made with

About the code

Hover Effect for Headers

8 hover effects for header in HTML and CSS.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: Header / About Page

Author

Made with

About the code

Header / About Page

Compatible browsers: Chrome, Firefox, Opera, Safari

Demo image: Header for Landing Page

Author

Made with

About the code

Header for Landing Page

Header for landing page using clip-path .

Demo image: Sexy Animated Rainbow Waves Header

Author

Made with

About the code

Sexy Animated Rainbow Waves Header

Just a little front-end UI experiment.

Demo Image: Hero Image Showcase

Hero Image Showcase

Hero image showcase with HTML, CSS and JS.
Made by Art
May 27, 2017

Demo Image: Hero Effect–Magazine

Hero Effect–Magazine

A hero image that uses height: 100vh to cover the entire screen for a magazine cover effect. When scrolled, it has a subtle animation similar to opening a magazine.
Made by Cameron Campbell
November 15, 2016

Demo Image: Flexbox Hero Header

Flexbox Hero Header

Simple parallax hero header with flexbox.
Made by Ana Vicente
April 5, 2016

Demo Image: Simple Parallax Header

Simple Parallax Header

HTML, CSS and JS simple parallax header with blur.
Made by tsimenis
April 5, 2016

Demo Image: Hero OnScroll

Hero OnScroll

HTML, CSS and JS hero on scroll.
Made by verdzik
November 9, 2015

Demo Image: Fullscreen Header With Background Color Cycle

Fullscreen Header With Background Color Cycle

Fullscreen header with background color cycle in pure CSS.
Made by Kenny Sing
November 17, 2014

Demo Image: Continuous Scrolling Background Of Sticky Header

Continuous Scrolling Background Of Sticky Header

Continuous scrolling background of sticky header in HTML, CSS and JavaScript.
Made by Robert Borghesi
September 17, 2014

Fixed (Sticky) Headers

Author

Made with

About a code

Blurry Header

Progressive backdrop blur experiment.

Compatible browsers: Chrome, Edge, Opera, Safari

Demo image: Just A Simple Header Bar

Author

Made with

About a code

Just A Simple Header Bar

Just a really simple pure CSS header bar.

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Author

Made with

About the code

Sticky Headers

Compatible browsers: Chrome, Edge, Firefox, Opera, Safari

Demo image: Sticky Header On Scroll

Author

Made with

About the code

Sticky Header On Scroll

High performance sticky header with shadow on scroll.

Demo Image: Responsive Scrolling Sticky Header

Responsive Scrolling Sticky Header

Using element queries to power a layout with a cover image and a nav that sticks to the top of the page on scroll.
Made by Tommy Hodgins
April 9, 2017

Demo Image: Scroll Header

Scroll Header

Really smooth on mobile/touch enabled devices.
Made by Blake Bowen
February 11, 2017

Demo Image: Responsive Scroll Header

Responsive Scroll Header

Responsive scroll header in HTML, CSS and JavaScript.
Made by Dylan Macnab
December 28, 2015

Demo Image: Animate Header In/Out After Scrolling

Animate Header In/Out After Scrolling

Using jquery-waypoints, well be checking to see when data-animate-header (this section) is above the top of screen, then animate data-animate-header (the fixed header) in/out accordingly. We’re able to do this with css transitions and a combo of 3 classes ( .header-past , .header-show , .header-hide ) — without having to clone or do any dom manipulating.
Made by antwon
June 16, 2015

Demo Image: Header Fade

Header Fade

HTML, CSS and JavaScript header fade.
Made by Emmanuel Pilande
March 7, 2015

Demo Image: Fixed Header Scroll Effect And Smart Nav For One-Page Sites

Fixed Header Scroll Effect And Smart Nav For One-Page Sites

Rudimentary combination of jQuery fixed header on scroll and nav active section class effect.
Made by Summer
February 2, 2015

Demo Image: Auto Hide Sticky Header

Auto Hide Sticky Header

Setting classes on the header with JavaScript.
Made by jasper
January 21, 2015

Demo Image: Sticky Header CSS Transition

Sticky Header CSS Transition

Fun example of a sticky header utilizing some CSS3 transitions!
Made by Brady Sammons
October 23, 2014

Demo Image: Top Sliding Nav

Top Sliding Nav

Hidden nav that slides in from the top once the page is scrolled.
Made by Chris Gruber
October 20, 2014

Demo Image: Responsive Sticky Header Navigation

Responsive Sticky Header Navigation

Cool navigation with HTML, CSS and JS.
Made by MarcLibunao
June 8, 2014

Demo Image: Fixed Header (Quick Hack)

Fixed Header (Quick Hack)

The header is not fixed with a solid background color and there is a fixed div at the top that is small. Then there is a div that is not fixed within the header with the title. Simply wanted to try and prototype the idea. Works in a decent hack-ish sort of way.
Made by Darcy Voutt
March 21, 2014

Demo Image: Sticky Header Visual Trick

Sticky Header Visual Trick

Creates a sticky hacky sticker header using CSS without creating a scroll event handler.
Made by Michael
July 19, 2013

Video Headers

Demo Image: React Video Header

React Video Header

Simple React.js video header.
Made by Mark Sarpong
June 2, 2017

Demo Image: Video Header

Video Header

Video header with HTML, CSS and JavaScript.
Made by Alex
February 6, 2017

Demo Image: Hero Video

Hero Video

A pen that shows how to create a hero with a background video.
Made by Chris Simeone
October 20, 2016

Demo Image: Fullscreen Background Video With Mix-Blend-Mode Overlay Text

Fullscreen Background Video With Mix-Blend-Mode Overlay Text

Shows full-screen video with effective, legible text overlay using mix-blend-mode .
Made by Dudley Storey
September 8, 2016

Demo Image: Video Header Animation

Video Header Animation

Animation was customized used Adobe After Effects and rendered to be compatible across all browsers with .ogv and .webm files. Does not operate in mobile (intentionally). Bootstrap framework for HTML is used, no JavaScript needed.
Made by Sylvia Maguia
October 4, 2015

Demo Image: Responsive Video Header

Responsive Video Header

Responsive video header with gradient in HTML and CSS.
Made by Jacob Davidson
May 29, 2015

Источник

Оцените статью