Forum Moderators: open

Message Too Old, No Replies

Need for a common header/footer (HTML or XHTML? Or both?)

         

hperlman

1:36 pm on Jul 6, 2005 (gmt 0)

10+ Year Member



I work for a Federal agency (US Geological Survey), I've been working a lot with both CSS and XHTML standards (trying to convince the rest of the Web developers in USGS to use them!).

We just got a mandate from National Headquarters that all USGS web pages must use a certain fixed header and footer file. When I looked at the CSS and header, etc, I noticed some possible problems, and now I'm on a committee to look into revising the CSS and header, footer.

The header they sent out is written using plain HTML. Now, I now code in XHTML.

Well, here is their header file (below). Yes, I see nested TABLES (I assume this could done without tables, but ...). I see spacer gifs... I see they don't have TITLE attributes to help explain links and images.....and partial implementation using CSS... But, notice they use HTML coding instead of XHTML. Now, if I use a DTD for XHTML won't this header cause problems with my code, since my code will not verify for XHTML?

My question: Do we have to offer multiple header files? One in XHTML and another in HTML? Or, if we build a single header (and footer) in XHTML, would that work fine for everyone, even if they use use a DTD of HTML Transitional?

As a Gov't agency putting out Web pages, I just feel we ought to abide by standards and I fear the people who developed these files did not.. But, now that I'm the "complainer" and on the committee, they will expect me to be an expert in these matters - so I wanted to be able to offer correct advise.

Thanks a lot
Howard Perlman

--------------------------------------------------------------------------------------------------
<!-- BEGIN Header Template -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr> <td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="178" align="left"><a href="http://www.usgs.gov"><img src="header.jpg" alt="Link to USGS home page." width="178" height="72" border="0"></a></td>
<td width="100%" class="banner">
<table width="150" border="0" align="right" cellpadding="0" cellspacing="0" class="ccsa">
<tr>
<td><img src="spacer.gif" width="1" height="72" alt=""></td>
<td><a href="http://www.usgs.gov" class="ccsa">USGS Home</a><br>
<a href="index.html" class="ccsa">Contact USGS</a>
</tr>
</table>
</td></tr></table>
<img src="spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr><td class="siteTitle">Enter Site title </td></tr>
</table>
<!-- END USGS Header Template -->

[edited by: BlobFisk at 1:44 pm (utc) on July 6, 2005]
[edit reason] No sigs please - see TOS #13 [/edit]

encyclo

2:25 pm on Jul 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld [webmasterworld.com] hperlman! (You might want to check out the Terms of service [webmasterworld.com] relating to the use of specifics and signatures.)

It appears that your organization is attempting to enforce some markup and style (CLF - Common Look and Feel) guidelines, but that the process is rather incomplete. If you are in a position of influence you should really be looking to recommend a particular set of standards to follow including the use of a particular HTML version. I would recommend either choosing HTML 4.01 Transitional (perfect if you have a lot of legacy content to convert) or XHTML 1.0 Transitional if you prefer.

If you are using mixed HTML/XHTML, the markup snippet you gave would produce only minor validation problems with XHTML 1.0 Transitional (missing trailing slashes) which would have no impact of compatibility or functionality. It could do with some improvement however, in particular the removal of the spacer GIFs and the moving of at least certain deprecated attributes to an external stylesheet.

hperlman

2:50 pm on Jul 6, 2005 (gmt 0)

10+ Year Member



Hey ... thanks!

Yes, that is just the point - this is THE time to make sure the style sheet and header are the best we can do. And I can have influence, since I complained first! So, I need to get this right.

A few things for me to learn..
(1) Are you saying we don't need multiple header files (one for HTML 4.01 and one for XHTML)? I still want my XHTML to verify (I thought that was important).

USGS has thousands of pages. Some very old. Also, MANY page developers barely know HTML, let alone even heard of XHTML. Now, the template being sent out doesn't have the DTD line in it, so that is a good thing. But, should I recommend having 2 header templates, one in XHTML format and one in plain HTML?
Or, if we had the header in XHTML only, would that work fine for all DTDs and browsers...

And, I plan on rewriting the header to make best use of CSS and move deprecated tags to CSS. And, try to reduce the nested tables...

Thanks

encyclo

3:12 pm on Jul 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, you could have two versions of the header, one for HTML and one for XHTML - but it would be best to decide on which standard you want to aim for accross all the documents and produce a common header which validates for that doctype.

For example, you decide on a policy that future documents should be authored to validate against XHTML 1.0 Transitional, and legacy documets are to be converted gradually over time. Your header should therefore be valid XHTML, and even if it is used on legacy HTML documents it will still function correctly. Validation is important to improving the markup and removing major errors, but if the errors are minor, then there are other much more important matters. Most public websites need to adhere to legally-mandated accessibility guidelines, and your efforts should be concentrated in that area even at the expense of a certain amount of invalid markup. You won't be sued for having invalid HTML, but you could well be sued if your site is not accessibile.

I would search around for some pre-existing CLF guidelines for other governmental agencies and see if you can learn from them and adapt them to your needs.

hperlman

3:41 pm on Jul 6, 2005 (gmt 0)

10+ Year Member



Thanks again!

Well, I did just take their header and converted it to XHTML tags and then used the DOCTYPE for HTML4.01. And, yes, it still validated fine. That means that we should be OK making the header XHTML and it should work for all of our new and old pages ... um, right?

But I might bring up having 2 header files, just to make the committee think about it...

With funding so bad, I know we'll never convert our old pages to XHTML. And, if I mentioned, many of our "webmasters" barely know HTML to begin with. What we need to do is to get them to code their new pages to standards (quote attributes, lower case tags) and to use CSS instead of <CENTER> and <FONT>. I plan on mentioning the ideal case is to make future pages validate to XHTML, but, as you say, it is even more important for them to adopt CSS, to improve accessibility.

So, thanks again.