Forum Moderators: open
I've been using HTML 4.01 Transitional, don't know why except for that is what I got to validate so I just stuck with it.
thanks.
Also a personal recommendation. If you are already writing valid HTML transitional mark-up, then the shift to transitional XHTML is pretty simple. But the step I engourage you look at is learning STRICT mark-up.
You can even write HTML 4.01 strict (rather than XHTML) - and unless you have some compelling reason for XHTML (like the need for XML integration or something similar) there is little to be gained, as far as I can see, in going to XHTML 1 transitional.
Whatever you decide, the link above is a great place to get your feet wet with any web technology they offer tutorials for.
I've been converting my site from a 3-frame page to one page and css as much as possible. So I thought if I was going to spend all this time making our site accessible I might as well get it valid and then thought why not go to xhtml since everyone talks about it.
thanks I'll look at it.
Validate your code to the current doctype
Close and properly nest all tags
Structure page content with headings, paragraphs, and lists
Write all tags in lower case
Enclose attributes in double quotes
Use CSS for formatting
With help from the people here at webmasterworld, this is how I solved my problem well going to xthml 1.0 strict.
Add this to a .js file,
if( window!= window.top ) { top.location.href = location.href; }
function NewWindo() {
if(!document.getElementsByTagName ) { return; }
var anchors = document.getElementsByTagName( "a" );
for( var loop = 0; loop < anchors.length; loop++ ) {
var anchor = anchors[ loop ];
if( anchor.getAttribute( "href" ) && anchor.getAttribute( "rel" ) == "external" ) {
anchor.target = "_blank";
}
}
}
and the following to your body tag,
<body onload="NewWindow()">
Another thing to remember is to use xhtml 1.0 and not xthml 1.1. If you want to know why you will get a lengthy confusing answer or you can just take my word for it.
I have one question though. here is a quote of my page validation (or lack thereof):
Line 22, column 119: there is no attribute "name"...nu-smallb.jpg" alt="Banner" name="banner" id="banner" /></a>
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.
So I cannot use the name attribute? How do I get around this?
edit: the heck with it, I'll just use xhtml 1.0 transitional, like tedster said to do.
thanks again.
The reasoning behind going to strict is to create a cleaner more logical script. Doesn't seem very logical (or clean) to have two tags that do the exact same thing.
As for staying compatable with older browsers, thats a very debatable issue. There has to be a certain point where you stop supporting older browsers. For example, if i'm not mistaken, IE 3 doesn't support CSS.
Hardly any computers, that are used on a regular basis, are going to last over 6 years anyway, and if there is a person with a computer thats over 6 years old they probably almost never use it and so why build your website to support that person who almost never uses their computer anyway. So if my theory that most computers don't last over 6 years then their really is no point in trying to go out of your way to support browsers over 6 years old.
Think about it for a moment. Their sits a person booting up their windows 95 computer that he/she hasn't updated in 10 years and is still using IE 4. I think being able to view your website is going to be the least of their problems.
we are a small college where most people are on 56k because of the lack of broadband internet services. On campus they keep everything updated so it isn't an issue on campus where it probably gets the most use anyways since they set the homepage to our site and tell the students to go there to do anything. When I was first making the switch from frames to css I thought about just making sure the pages looked good in IE6 since that is what the majority of the users had, but then I thought no I want it to look good in any browser ( well IE, FF, Opera). And since we are required by law to have our site accessible I figured I might as well get the html validated too.
As far as using JavaScript, I don't mind since the menu I use, uses it.
edit: well, I'll stick with xhtml 1.0 transitional. I tried your JavaScript file and edited one page and it broke my menu system. I'm happy with using transitional so it is fine.
----Don't really need to read below this line, its just there for some general info as to why my pages are like they are. ------
I might just end up dropping the name attribute then. Another note on that issue is that when they told me to get our site accessible I was doing everything I could to get it to that point. Me and Cynthia Says was going round and round. I think that is the main reason the name attribute is there was so that she would validate it as being accessible.
I'm new to this whole accessibility issue and doctypes. I started working here a little less than a year ago after being fresh out of college where they didn't teach us all of this so I'm picking up things and implementing them. I know this might not be the best way, but at least I'm learning more.
As far as using JavaScript, I don't mind since the menu I use, uses it.
I have read some great discussions on webmasterworld about using javascript menus and menus in general. You might consider starting a new thread discussing the ups and downs of using a javascript menu system. There truly are some great webmasters here and you can learn quite a lot. It may be out of the scope of the time you have but maybe at a later date you might consider coming back here and discussing it.
Some of the rules I kinda remember off the top of my head are,
1) A maximum of 7 main categories
2) Keep main and sub categories seperate
3) No mouse hover techniques of any sort
But this is more than you came here to ask about in this thread. Just giving you a heads up.
4.10. The elements with 'id' and 'name' attributes [w3.org]
The above link is also a great area to learn a little more about the issues you'll be faced with when making the switch to XHMTL.