3 validation errors- unsure of how to correct - html

Line 10, Column 43: Bad value FRSH Studio for attribute href on element link: Whitespace in path component. Use %20 in place of spaces. <link rel="pingback" href="FRSH Studio" />
--- It is my understanding that this is pulled from my settings in Wordpress. When I change the setting to include the %, I'm given an error stating that "Path component contains a percent sign that is not followed by two hexadecimal digits." How do I fix this?
Line 146, Column 7: End tag for body seen, but there were unclosed elements. </body>
--- I believe this is referring to <div id="container">...
Line 54, Column 20: Unclosed element div. <div id="container">
--- When I close the container using </div><!-- end container --> in the footer, I'm told that it is a stray tag. Where should </div><!-- end container --> be?
Not sure why this was sent away from Wordpress Stackexchange. The site validates as HTML. It is only when validating the site, which is Wordpress, using the URI via w3c's validator that these errors arise.

Put the full code inside the HTML Tidy and make it valid. Use this: http://infohound.net/tidy/
HTML Tidy is a tool for checking and cleaning up HTML source files. It is especially useful for finding and correcting errors in deeply nested HTML, or for making grotesque code legible once more.
This online version enables you use it without installing the client tool on your PC.

The "stray tag" error may be due to the fact that the page is being parsed as XHTML, where every opening tag (e.g. <!-- end container -->) requires a closing tag.
The best HTML validator is here:
http://validator.w3.org/
That will offer an option to clean up with HTML Tidy as others have mentioned.

1) The href has to be a valid link.
<link rel="pingback" href="http://frshstudio.com" />
2/3) Perhaps you have closed it in the wrong place?
Can you please post code?

Your site appears to be generating bad HTML pages.
1) The value for "href" should be a URL.
2) If you have a "div" start tag, then there needs to be a "div" end tag as well. This may be missing.
3) Would need to see the entire source to be helpful.
As someone suggested, you can use http://validator.w3.org/. Another validator (for Windows so it's offline and it does a lot more) is CSE HTML Validator at http://www.htmlvalidator.com/

Related

Using html tags without <html> tag?

So i have an example , In my example.html
,I am using
<h1>example</h1>
While running with browser it is giving correct output.
But still I am finding how these tags works without <html> tag.
My finding says -
.html extension will consider these tags
Latest browsers is considering
Is there any other valuable answer regrading this?
The specification defines the HTML element as having start and end tags that may be omitted.
If you don't include them explicitly, the parser is required to imply the start and end of the element from context (which it can do unambiguously).
An html element's start tag can be omitted if the first thing inside
the html element is not a comment. An html element's end tag can be
omitted if the html element is not immediately followed by a comment.

Are the tags/comments in HTML auto-corrected by browsers?

Instead of
<!--
,
I used
<!-
...and it is working.
How?
It's not actually working - it's just interpreting it as an actual tag, and then throwing that tag out as invalid.
<!- foo bar -->
is treated as a tag, <!-foo bar--> which obviously isn't a standard HTML tag, and thus is ignored.
Try this, and you'll see it's not truly working as a comment:
<!- >foo bar-->
Modern browser parsers (i.e. those that use the HTML5 parsing algorithm) work like this. If they are expecting text or a new tag next, and they see <! then they check the next few characters to see if they are -- or DOCTYPE or, if they are processing embedded SVG or MathML, [CDATA[. (See http://dev.w3.org/html5/spec/tokenization.html#markup-declaration-open-state)
If, as in the case of <!- foo, none of these match then the parser enters the bogus comment state where all the characters following, up to the next >, are read and and converted into a comment to be put into the DOM.
Hence the behaviour you see with <!- working like a comment start. Note that such behaviour is "repair" behaviour for broken markup and it's wise not to rely on it.
You can see how such markup forms a DOM here: Live DOM Viewer
Also note that this is different to what #Amber says. It is not treated as a tag in any meaningful sense, and it is certainly not ignored.

Unclosed <a> or <div> tag somewhere on page causing unwanted hyperlink

This is my page: http://mysampletestsite345.com
The white box is populated by a mySQL table using a basic PHP loop. For some reason, the last link in the box is attaching itself to the Twitter feed on the right side as well as the Copyight 2011 text, which I do not want. I can't tell where the missing tag goes. Anyone willing to donate a pair of eyes to my problem?
Test the URL at validator.w3.org and you'll get a response quickly:
Warning Line 113, Column 314: unclosed
start-tag requires SHORTTAG YES
…uld end up as one of the biggest
draft or waiver wire steals of the
year.'</a>
The construct <foo<bar> is valid in
HTML (it is an example of the rather
obscure “Shorttags” feature) but its
use is not recommended. In most cases,
this is a typo that you will want to
fix. If you really want to use
shorttags, be aware that they are not
well implemented by browsers.
Looking at the markup, I found that the image tag on line 113 was not closed:
<a href = 'http://smysampletestsite345.com/dir/page1'>
<img
width = '500px'
style = 'vertical-align: middle;'
src = '/images/sample.jpg'
title = '<h2>Best [..] of the year.'</a>
You should put a > before the closing </a>. This error occurs in the lines following 113 as well.

double hyphen in script makes firefox render strangely

<!-- <script type="text/javascript">/*<![CDATA[*/ c-- ;//]]></script> -->
When I have the above line in the <head> section of a plain html page, Firefox 3.5.5 renders the trailing --> as text. If I change c-- to c- it doesn't. Any ideas what's going on here? I getting an artifact on my pages with this due to a very large script that's been crunched. I can change the statement to c-=1 and avoid the problem for now but.... I'd like to know what bit/byte is biting my a$$.
This is due to Firefox implementing SGML (on which HTML was based) comments strictly. This will only occur when the document is loaded in standards mode (i.e. there is a DOCTYPE).
The first <! starts a comment. The first -- enters a section in which > characters are allowed. The second -- (in your script) leaves the section in which > characters are allowed. The > at the end of </script> then ends the comment. The following --> is therefore no longer part of the the comment and gets rendered as text.
See http://www.howtocreate.co.uk/SGMLComments.html for a comprehensive guide to the issue.
Its also worth noting that the HTML 4 Specification says that 'authors should avoid putting two or more adjacent hyphens inside comments' and the HTML 5 Specification says comments must not 'contain two consecutive U+002D HYPHEN-MINUS characters (--)'.
The solution, as you've found, is to not include -- in the middle of a comment.
Technically you are not allowed to have double hyphen in a comment in HTML (or XML). So even if browsers "allow" if it is not valid and should fail an HTML validator.
See Comment section of HTML 4 Specification
I can't replicate this. Doesn't show up on 3.0.1.

End tag for element "div" which is not open. HTML validation errors

What do the following error messages mean?
I'm validating my website, but I'm getting these weird messages about tags. I have an opening div at the top of the page, but I still get these errors. Are they false warnings?
# Error Line 195, Column 7: end tag for element "div" which is not open
</div><!-- wrapper -->
The validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.
If this error occurred in a script section of your document, you should probably read this FAQ entry.
# Error Line 195, Column 7: XML Parsing Error: Opening and ending tag mismatch: body line 16 and div
</div><!-- wrapper -->
# Error Line 208, Column 8: XML Parsing Error: Opening and ending tag mismatch: html line 2 and body
</body>
You would have to delete that </div> as it doesn't seem to have an opening match. Try to erase it and revalidate.
You should have an open div tag like
<div></div>
It thinks it found a closing tag with no matching opening () tag.
It may be that the page author deleted the opening tag and forgot to delete the closing tag. It could also be that you have tags mis-nested, something like this:
<h1>
<div ...>
...
</h1>
</div>
Hope that helps.
The most common reason for the validator to say that the tags don't match is that the tags don't match. However, it's not certain that the tag is actually missing. There may be other errors that could cause the ending tag to be skipped. You might for example have a missing ending quote for an attribute in a tag, which would cause the following tags to be part of the attribute value until the next quote in the code.
Verify that the page contains the correct opening and closing tags. You can open the page in something like Firebug in Firefox or Developer Tools in Internet Explorer 8 to see how it displays the tag structure that the browser has parsed.