File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes multiple HEAD, BODY and HTML tags okay? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "multiple HEAD, BODY and HTML tags okay?" Watch "multiple HEAD, BODY and HTML tags okay?" New topic

multiple HEAD, BODY and HTML tags okay?

paul wheaton

Joined: Dec 14, 1998
Posts: 20919

I've inherited some jsp code that generates html pages that have lots of HEAD, BODY and HTML tags. I always thought that any html page is supposed to have no more than one of each of these. Not so? Should I expect problems?

permaculture Wood Burning Stoves 2.0 - 4-DVD set
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Rule of thumb is only one set of head tags, body tags etc. I have seen multiple tags, might give older browsers a headache....On microsoft site, they recommended two head tags for cache I guess it is doable, but not a great practice.
Peter den Haan
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Originally posted by Eric Pascarello:
On microsoft site, they recommended two head tags for cache problems...
Then it no longer satisfies the HTML DTD, and quite simply ceases to be HTML. IE may still display it, but there's no guarantee that any other user agent still will. Not that Microsoft would care.
- Peter
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4351

agreed. IE may accept it but it is wrong, wrong, wrong.

Visit my download page
Balaji Loganathan
author and deputy

Joined: Jul 13, 2001
Posts: 3150
Testing the output in Netsacpe naviagtor 4.7 will also help you see what is missing.
I had the same problem(accidently) and the netscape just displayed the blank page.
[ January 28, 2003: Message edited by: Balaji Loganathan ]

Spritle Software Blogs
I agree. Here's the link:
subject: multiple HEAD, BODY and HTML tags okay?
It's not a secret anymore!