WeLoveCSS Logo
Home Profile Members Search Rules Help New Posts



WeLoveCSS > WEB DESIGN > HTML & XHTML > [SOLVED] Validating HTML4 Strict

Reply
  Thread Tools Display Modes
Old 25th May 15, 12:11 AM   #1
desk
WLC Member
 
desk's Avatar
 
Join Date: May 2015
Location: Melbourne, Australia
Posts: 22
Default Validating HTML4 Strict

On one page, the only error is the term 'target=_blank', in -

<div class="middle">
<h3><strong><a href="intro.htm" target=_blank>INTRODUCTION</a></strong></h3>
<hr></div>

Apparently, it is "an unsupported attribute for this element". Since other similar links validate, I'm thinking it is because it is contained in a heading, h3. I can't find any mention of this, nor suggestions on how to fix it.

Another couple of problems cropped up with a script for a search box, supplied by Google -

<!-- Search Google -->
<script>
(function() {
var cx = '016497875066626780753:750v_phc7yc';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>
<!-- Search Google -->

Validator says <script> needs an attribute "TYPE", & that <gcse:search></gcse:search> starts with an undefined element. I'm loath to fiddle with the script, as the search box functions well & I know nothing of scripting.

So, whether to go for 100% Strict, or just live with these 'errors'? That is the question.
__________________
/*<--Desk-->*/
desk is offline   Reply With Quote
Old 25th May 15, 01:55 AM   #2
Phreaddee
WLC Lover
 
Phreaddee's Avatar
 
Join Date: Oct 2010
Location: Newcastle, NSW, Australia
Posts: 768
Default Re: Validating HTML4 Strict

target="_blank"
not
target=_blank

yes if it is html4 strict the <script> tag will need to have the type="javascript" attribute added to it, however if you were using html5 (which I would recommend) it need just be <script>

in any case if the google script is what is causing it to not validate, I wouldn't concern myself too much, after all, that isn't something YOU'VE done!
Phreaddee is offline   Reply With Quote
Old 25th May 15, 06:46 PM   #3
desk
WLC Member
 
desk's Avatar
 
Join Date: May 2015
Location: Melbourne, Australia
Posts: 22
Default Re: Validating HTML4 Strict

I tried the quotes, but they didn't work. Nor did removing h3, rearranging the order of tags, etc. All very strange, since other links, in identical formats, immediately follow, & they satisfy 4.01 Strict validation.
Taking a hint from your later remarks, I changed the Doctype & charset & validated under Html5. Hey presto, the errors vanished!

Except for the seemingly-empty <gcse:search></gcse:search>, which gave an error warning. On removing it, I loaded the file & the Google search box failed to appear. When reinstated, a fully-functioning search box reappeared.

Which leads to another, more general question - is Html5 backwardly compatible? Some of its features are attractive (e.g. <figure>), but I would not wish to confound older browsers.
__________________
/*<--Desk-->*/
desk is offline   Reply With Quote
Old 25th May 15, 08:13 PM   #4
meesa
WLC Mod
 
meesa's Avatar
 
Join Date: Jul 2009
Location: Milky Way Galaxy
Posts: 3,710
Default Re: Validating HTML4 Strict

Not everything will validate when using third party code. There's a standard, but that doesn't mean it's always followed. the gcse:search tag is not apart of the standard, and will never pass, even though it should work right on any modern browser.
__________________
Praise be to the Lord God for the ability to learn, the capability to analyze, and the time to help users on this forum.
meesa is offline   Reply With Quote
Old 5th June 15, 04:13 AM   #5
desk
WLC Member
 
desk's Avatar
 
Join Date: May 2015
Location: Melbourne, Australia
Posts: 22
Default Re: Validating HTML4 Strict

After fully validating a couple of pages, I now feel confident enough to leap straight into HTML5 for the remaining 18! So thanks for your help, & I'll mark this thread as 'closed'.

(Though I do wonder whether I should upload pages as I go, or wait till I've finished the lot, with the full style sheet...)
__________________
/*<--Desk-->*/
desk is offline   Reply With Quote
Old 6th June 15, 06:00 AM   #6
meesa
WLC Mod
 
meesa's Avatar
 
Join Date: Jul 2009
Location: Milky Way Galaxy
Posts: 3,710
Default Re: Validating HTML4 Strict

Either way works.
__________________
Praise be to the Lord God for the ability to learn, the capability to analyze, and the time to help users on this forum.
meesa is offline   Reply With Quote
Reply


Thread Tools
Display Modes
Linear Mode Linear Mode

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:48 PM.



Home | Advertise | Contact Us | Top
Home | Advertise | Contact Us | Top

Copyrightę 2006 WeLoveCSS.com. All Rights Reserved.
Powered by vBulletin Version 3.8.4 Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.