Jump to content

XHTML's very strict codes


duki19super
 Share

Recommended Posts

I'm trying to make a web-site with valid xhtml 1.0 code. There is a lot of code on w3schools site that doesn't pass w3c validation for xhtml like this one <img src="example.png" border="0"> or this one: <bgsound="example.wav">. The code for bgsound I figured out by myself: <object height="0%" width="0%" classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"><param name="AutoStart" value="9" /><param name="FileName" value="example.wav" /></object> and you have to put it before or after <html></html>.If anyone knows the valid xhtml code for the border in <img src=""> please post it.

Link to comment
Share on other sites

if you looked at the DOCTYPE of the w3schoold pages you realize that it is not XHTML strict but XHTML Transitional which is far less picky.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
That is why the pages don't valid to XHTML Strict...because they are not. :) :)
Link to comment
Share on other sites

Try this code, you should use css to style your pages<img src="1.jpg" style="border: 0px solid green" />

If you have a border of zero, then why tell it to be green if there is no border to be green? :)style="border:0" works just as well, without the extra code of having "sold green" attached to it.The less the code, the less the filesize, and the faster the page load :)
Link to comment
Share on other sites

If you have a border of zero, then why tell it to be green if there is no border to be green? :(style="border:0" works just as well, without the extra code of having "sold green" attached to it.

yep, i just cut and paste from one of my pages, forgot to take "solid green" out!!
The less the code, the less the filesize, and the faster the page load :)

A bit OTT there i think, the extra values didn't make a jot of difference to the file size :)
Link to comment
Share on other sites

Maybe, but if you look very closely, there are usually a few bites taken off the filesize.So, for example, if the file had 552bites, if you remove "sold" and "green" and "px" (because a value is zero doesn't need to be defined by pixels or percentages) then look at the bites (not kilobites because that can sometimes gives a false reading of the actual filesize) then it might be something like 548bites.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...