Can someone please explain to me exactly what XHTML is supposed to do, or rather what makes it better than normal HTML? And also - where's a good place to learn how to write XHTML properly (bearing in mind I already know basic HTML)?
Thanks
Mike
Can someone please explain to me exactly what XHTML is supposed to do, or rather what makes it better than normal HTML? And also - where's a good place to learn how to write XHTML properly (bearing in mind I already know basic HTML)?
Thanks
Mike
"Well, there was your Uncle Tiberius who died wrapped in cabbage leaves but we assumed that was a freak accident."
check out w3schools. Basicly the way you type XHTML is stricter and cleaner than HTML. In other words its has more organised structure.
XHTML is HTML following the XML guideline e.g. all tags should be closed
e.g.
HTML
<b>text</b>
<img src="blah.gif">
XHTML
<b>text</b>
<img src="blah.gif" />
Note the closing / on tags which don't normally have them
There are other rules but that's a brief taster
Thanks guys, looking through those pages as we speak - I think it's going to take a while to sift through all of my pages, but I'll get there!
"Well, there was your Uncle Tiberius who died wrapped in cabbage leaves but we assumed that was a freak accident."
Okay, quick question - ran one of my pages through the validator and it tells me I can't use bgcolor or text attributes in the <body> tag - so what do I use instead?
Thanks
Mike
Edit: This happens with the color attribute in the <font> tag as well.
Last edited by mike_w; 19-11-2004 at 06:24 PM.
"Well, there was your Uncle Tiberius who died wrapped in cabbage leaves but we assumed that was a freak accident."
Not sure if this is correct but if i saw that i would apply bg colours and fonts to the body using CSS. If ur not sure it would go somthing along the lines of:
<style type="text/css">
body {
background-color: #000000;
font-family:Arial,Verdana, sans-serif;
font-size: 12px;
}
</style>
This would go inbetween the html head tags.
Last edited by Dorza; 19-11-2004 at 08:27 PM.
Thanks, just discovered that by looking at other XHTML compliant sites. I've just found out how to make classes in a stylesheet, so I think I've got it cracked!Originally Posted by Dorza
"Well, there was your Uncle Tiberius who died wrapped in cabbage leaves but we assumed that was a freak accident."
I found that reading the css section on that site i provided was very easy. You can pick css up very fast. I did anyway![]()
Well, the XHTML is relatively simple so far... just taking a very long time to convert all of my pages!Originally Posted by Dorza
"Well, there was your Uncle Tiberius who died wrapped in cabbage leaves but we assumed that was a freak accident."
Okay - last questions now (I really hope so - I've checked all of the pages with the validator and these are the only errors that I can't solve).
Firstly, how do I solve this error:
Secondly, how do I remove borders from frames?Line 5, column 6: end tag for "head" which is not finished
Thirdly, how do I open links in a new page (since target="_blank" doesn't work)?
Finally, how do I solve this error:
All the help is greatly appreciated!No Character Encoding Found! Falling back to UTF-8.![]()
"Well, there was your Uncle Tiberius who died wrapped in cabbage leaves but we assumed that was a freak accident."
If you want no frameborder:
Frameborder="0" and border="0" in the framset tag. You will also want noresize to stop the scrollbar appearing when the page content is too large to fit in the frame.
Close the head tag with </head>
Try _new for target.
You have to specify the ecnode type for the page/site. Can't remember how, you can do it in your style sheet (best). Somthing like enctype I believe. Try google or wait for a response.
To err is human. To really foul things up ... you need a computer.
Already tried that, but the validator doesn't like it.Originally Posted by yamangman
I have! Here's the template I use for all my pages, and even this generates that error!Close the head tag with </head>
Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> </body> </html>I think the problem is that you can't use "target=" at all, and _new still generates errors.Try _new for target.
"Well, there was your Uncle Tiberius who died wrapped in cabbage leaves but we assumed that was a freak accident."
"target" isn't a part of XHTML, but it can be imported to the DOM somehow (apparently easier than it sounds, but I've never had to do it.)
replace target="_blank" with rel="external" and load the following JavaScript in your page
I haven't found another W3C compliant way of getting round itCode:function externalLinks() { if (!document.getElementsByTagName) return; var anchors = document.getElementsByTagName("a"); for (var i=0; i<anchors.length; i++) { var anchor = anchors[i]; if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank"; }
I seem to have found a way to get around using target - is there anything wrong with using this method (validator doesn't complain when I use it):
<a href="example.html" onclick="window.open('example.html', '_blank', ''); return false;">Example</a>
"Well, there was your Uncle Tiberius who died wrapped in cabbage leaves but we assumed that was a freak accident."
It's fine except that if you want to add in parameters etc then you don't have any central control. The method I indicated means you can do anything to every link on your site that opens in a new window by altering the one function rather than going through every link manually
There are currently 1 users browsing this thread. (0 members and 1 guests)