| Welcome to Webforumz.com. |
|
Jan 13th, 2008, 21:46
|
#1 (permalink)
|
|
Reputable Member
Join Date: Mar 2007
Location: Tanzania
Age: 19
Posts: 209
|
Closing tags in the validator
I have validated my page gives some errors but I dont know how it came up with them. Looks like all the closing tags > are all wrong. What could be the problem?? Checkout...
__________________
with great power comes with great responsibility :kicking: | this is me
|
|
|
Jan 13th, 2008, 21:48
|
#2 (permalink)
|
|
Section Manager - WOTM Assistant Editor - LZ
Join Date: May 2007
Location: Cornwall, England
Posts: 1,102
|
Re: Closing tags in the validator
You are not closing img tags correctly. You are using:
- Code: Select all
<img src="image">
But for a xHTML doctype, it should be:
- Code: Select all
<img src="image" />
HTH
|
|
|
Jan 13th, 2008, 21:50
|
#3 (permalink)
|
|
Administrator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
|
Re: Closing tags in the validator
Moved to accessibility section.
You are using an XHTML doctype this means you need to self-close elements.
e.g. this:
- HTML: Select all
<link href="style.css" rel="stylesheet" type="text/css">
becomes:
- HTML: Select all
<link href="style.css" rel="stylesheet" type="text/css" />
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.
|
|
|
Jan 13th, 2008, 22:19
|
#4 (permalink)
|
|
Reputable Member
Join Date: Mar 2007
Location: Tanzania
Age: 19
Posts: 209
|
Re: Closing tags in the validator
is this wrong? Its from the google analytics code
- Code: Select all
…s.com/ga.js' type='text/javascript'>\<\/script>" );
__________________
with great power comes with great responsibility :kicking: | this is me
|
|
|
Jan 13th, 2008, 22:37
|
#5 (permalink)
|
|
Administrator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
|
Re: Closing tags in the validator
I don't think there should be / inside those script tags.
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.
|
|
|
Jan 14th, 2008, 02:39
|
#6 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: Closing tags in the validator
xHTML doctype:
- HTML: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
__________________
|
|
|
Jan 14th, 2008, 05:52
|
#7 (permalink)
|
|
Administrator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
|
Re: Closing tags in the validator
Use a strict doctype:
- HTML: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.
|
|
|
Jan 14th, 2008, 06:37
|
#8 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: Closing tags in the validator
I never know the differences....
Thanks Sir, you made me read Doctype article from W3School!
Quote:
HTML
HTML 4.01 specifies three document types: Strict, Transitional, and Frameset.
HTML Strict DTD
Use this when you want clean markup, free of presentational clutter. Use this together with Cascading Style Sheets (CSS):
- HTML: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
HTML Transitional DTD
The Transitional DTD includes presentation attributes and elements that W3C expects to move to a style sheet. Use this when you need to use HTML's presentational features because your readers don't have browsers that support Cascading Style Sheets (CSS):
- HTML: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
Quote:
XHTML
XHTML 1.0 specifies three XML document types: Strict, Transitional, and Frameset.
XHTML Strict DTD
Use this DTD when you want clean markup, free of presentational clutter. Use this together with Cascading Style Sheets (CSS):
- HTML: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
XHTML Transitional DTD
Use this DTD when you need to use XHTML's presentational features because your readers don't have browsers that support Cascading Style Sheets (CSS):
- HTML: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
I've been using the wrong one! Damn! What a shame!
__________________
|
|
|
Jan 14th, 2008, 06:38
|
#9 (permalink)
|
|
Administrator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
|
Re: Closing tags in the validator
You're calling me sir too now? Ha.
We usually don't mind whether it's a HTML or XHTML Doctype, just as long as it's strict.
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.
|
|
|
Jan 14th, 2008, 06:45
|
#10 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: Closing tags in the validator
Yes Sir!  Here is another nice article I found!
Quote:
Why do you like HTML 4.01 strict? Isn't it SO last season?
That may be so, but it's still a valid W3C 'standard,' and it is the latest standard with any widespread support. I think most people overestimate the benefits of XHTML, at the same time as they underestimate the benefits of using a Strict DTD. In my opinion, using a Strict DTD, either HTML 4.01 Strict or XHTML 1.0 Strict, is far more important for the quality of the future web than whether or not there is an X in front of the name. The Strict DTD promotes a separation of structure and presentation, which makes a site so much easier to maintain. You can re-style a site completely by updating a single CSS file, rather than making identical changes to 10,000 pages with presentational markup.
It also has lots of benefits for the user (quicker download) and the server (less bandwidth), as well as for search engines (better content-to-markup ratio). Last but not least, it makes it a lot easier to create an accessible site.
The main cause of confusion seems to be that many web authors think that HTML must be written as 'tag soup.' The truth is that you can - and should! - write HTML 4.01 that is almost identical to XHTML 1.0. Just because HTML allows some shortcuts doesn't mean that you should use them. There are even beginners who have been conned into believing that CSS can only be used with XHTML, not with HTML!
|
__________________
Last edited by alexgeek; Jan 14th, 2008 at 07:02.
|
|
|
Jan 14th, 2008, 06:50
|
#11 (permalink)
|
|
Administrator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
|
Re: Closing tags in the validator
Try to post the source so we don't seem like copy cats
edit,
This is? http://webstandardsgroup.org/features/tommy-olsson.cfm
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.
|
|
|
Jan 14th, 2008, 07:00
|
#12 (permalink)
|
|
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
|
Re: Closing tags in the validator
Yeah, you are right about that link Sir! I got it from there! 
__________________
|
|
|
| Thread Tools |
|
|
| Rate This Thread |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|