3 replies [Last post]
alessiob
Offline
newbie
Last seen: 10 years 41 weeks ago
Timezone: GMT-4
Joined: 2011-10-22
Posts: 1
Points: 2

Having been searched this topic on enough forums I see that a lot of people are using an id tag instead of a footer tag for their footers. Could somebody please explain to me, the advantage or disadvantages of using either <div id="footer"> vs <footer>?

//mod edit: bbcode added to delimit html ~gt

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 year 22 weeks ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

Semantics vs support

The footer element is more semantic, but lacks support in older browsers, especially IE, which people and organizations tend to update with appalling lack of frequency.

In a practical sense, it makes little difference html-wise. There are differences where client side programming is involved, e.g. javascript. In one case, you can find the element "footer", in the other you must look for the id. It will limit code portability until older IEs die out.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 7 years 30 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

And to add - perhaps

And to add - perhaps obviously - <footer> is an html5 tag or I guess could be an XML one.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 7 years 43 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

<footer> doesn't always have to go at the bottom of your page

<footer>s, like <header>s can be used several times on one page, e.g. for the metadata for a blog post (or a list of blog posts).

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference