How to Do a Footer Div in CSS

Webpages consist of a number of divisions that form its layout (e.g., header, side bar, body and footer). HTML contains elements that are used to define these different divisions including, tables, spans, layers and DIV tags. Tables were often the preferred choice for defining webpage layouts. However, since the introduction of CSS, more developers are using DIV tags to define their webpages' layouts. DIV tags in conjunction with CSS can define the header, body, side bars and footers of webpages.

Things You'll Need

  • Text editor
Show More

Instructions

    • 1

      Open Notepad.

    • 2

      Type or copy and paste the following code into Notepad:

      <html>

      <style type="text/css">

      #body {

      background-color: #CCCCCC;

      height: 400px;

      width: 800px;

      }

      #footer {

      background-color: #FF0000;

      height: 50px;

      width: 800px;

      }

      </style>

      <body>

      <div id="body">Here is the body</div>

      <div id="footer">Here is the footer</div>

      </body>

      </html>

    • 3

      Click "File" and then "Save as." Select "All files" as the "Save as type."

    • 4

      Save your file as an HTML file by placing ".HTML" at the end of the file name. Example: myfooter.html.

    • 5

      Find your file where you saved it on your hard drive and double-click on it. It should launch in your Web browser. You should see a colorful page layout consisting of two divisions -- a body and the DIV footer at the bottom.

Related Searches:

References

Resources

Comments

You May Also Like

  • How to Put a Footer on a Web Page

    Most websites contain footers with information such as copyright dates, "about us" information and career opportunities. While it seems as if it...

  • How to Make a Side Bar in HTML

    When creating a website, you typically have a couple of options for the placement of a navigation menu. In some cases, this...

  • HTML Div Styles

    The DIV tag defines a division or section of an HTML document and used to apply styles to a group of elements....

Related Ads

Featured