Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

learning xhtml?



10:53 pm on Jan 19, 2005 (gmt 0)

10+ Year Member

Where is a site I can go to learn xhmtl? I thought I would put in the doctype into my existing page to see how many errors I had and I happened to have 172 so instead of not know how to fix it and playing with it until I got it right, I would rather learn the basics at least.

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.



11:05 pm on Jan 19, 2005 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Highly recommended: [w3schools.com...]

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.


2:30 pm on Jan 20, 2005 (gmt 0)

10+ Year Member

well, currently only a handful of my pages are valid.

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.


2:41 pm on Jan 20, 2005 (gmt 0)

10+ Year Member

As Tedster wrote, the transition from 4.01 to xhtml is fairly straightforward. You can write a site in 4.01 and prepare it for eventual conversion to xhtml by observing the following:

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


3:12 pm on Jan 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

One thing, it seems, that most people that go strict seem to run into is the lack of the ability to use "_blank" and "_top" tags. This causes many to stay with transitional. Using "_blank" is a debatable subject but removing "_top" could potentially cause people to frame your pages.

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()">

The first statement will keep all your pages on top so they cannot be framed. The NewWindow function will allow you to use the tag rel="externel" to replace the "_blank" tag and is xthml 1.0 strict.

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.


3:29 pm on Jan 20, 2005 (gmt 0)

10+ Year Member

i'll just take your word on it twist.

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.


6:18 pm on Jan 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

I should probably say nothing because I am not completely sure, but simple reasoning makes me wonder why you need a name and id attribute? If you need to refer to this element why not just use it's id?

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.


7:30 pm on Jan 20, 2005 (gmt 0)

10+ Year Member

I thought I read somewhere that the name attribute was for older browsers, but I could be wrong, as I've done lots of reading lately.


8:59 pm on Jan 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Your probably right. Thats the reason the only javascript I use is the code I mentioned above. Although, unless you use server-side scripting, sometimes javascript is the only answer.

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.


9:31 pm on Jan 20, 2005 (gmt 0)

10+ Year Member

yea, i know, but it could mean a loss of students, but if their computers are that old then more than likely they won't be on the net either.

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.


11:56 pm on Jan 20, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

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.


12:19 am on Jan 21, 2005 (gmt 0)

WebmasterWorld Senior Member pageoneresults is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

The name attibute has been formally deprecated in XHTML.

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.


Featured Threads

Hot Threads This Week

Hot Threads This Month