Semantics
HTML Footer
Creating Footer Sections
HTML footer contains closing content like copyright or contact info.
Introduction to HTML Footer
The <footer> tag in HTML is used to define a footer for a document or a section. It typically contains information about the author, copyright details, contact information, or links to related documents. It is a semantic element introduced in HTML5, designed to provide a consistent way to add closing content to your web pages.
Basic Structure of an HTML Footer
A basic <footer> element can include a variety of information. Here is a simple example that demonstrates its use:
Using <footer> Within Sections
The <footer> element can be used not only at the bottom of the entire page but also within individual sections. This provides a way to include specific closing content for different parts of your page. For example:
Common Uses for <footer>
Common elements found within a <footer> tag include:
- Copyright information
- Contact details
- Links to privacy policies or terms of service
- Social media links
Styling the <footer> Element
The <footer> element, like other HTML elements, can be styled using CSS to match the design of your website. For example, you can change the background color, font size, and padding:
Accessibility Considerations
Using the <footer> tag appropriately enhances the accessibility of your website. Screen readers can identify this element and provide users with information about the footer's content, ensuring a better user experience.