Tag Info

Hot answers tagged

34

I think it's definitely worth doing, but you should never be a slave to validation -- it's a fool's game. http://www.codinghorror.com/blog/2009/03/html-validation-does-it-matter.html Validate your HTML. Know what it means to have valid HTML markup. Understand the tooling. More information is always better than less information. Why fly blind? Nobody cares ...


32

I consider valid HTML a worthwhile goal, but do not see it as the be-all and end-all of building good websites. The trick is, your markup may be perfectly valid, yet it may not be semantic - e.g. using tables for layout or navigation. There's a difference between valid code and semantic code. On another note, if you use advertising or external scripts, ...


17

I like to use Honeypots in my forms since the user won't notice them, they keep most crap away but are not 100% foolproof. The trick is to make a new form field in your existing form, for example <input type="text" name="email" id="mailfield"/> and put #mailfield { display: none; } in your CSS. If your form is submitted with data in the email field ...


10

Technically, "#" is a well-defined URL reference that points to the start of the current document, so it is not “broken” in formal sense. It can, however, be regarded as bad for accessibility, and it is also a common symptom of “fake” links, i.e. a elements that are supposed to link to something external but depend on JavaScript. (In the very old days, <a ...


9

To save time I use a Firefox Extension called HTML Validator. It adds validation to your view source window, tells you errors and warnings in a bottom pane. Also puts an icon in the bottom of your window showing you a quick reference for yes/no on validation. If no, then you just view source and it shows you exactly what your errors are. Also validates ...


8

Use a combination of timestamp, spinner, field names, and honeypots... Read this article for the detailed example. A timestamp is exactly what it sounds like. A hidden field that marks the time when the form was originally opened. This defeats playback bots that copy a form and replay back the submission process over and over with different data each time. ...


8

Validation in of itself isn't so critical, since few browsers are 100% compliant and the spec isn't 100% clear on how to interpret the rules. However being valid HTML puts you in a better position to adapt and improve your site. As the standards move, they will typically migrate forward and if you new site is valid, then updating to support the latest ...


8

Since CSS3 is not a completed spec and probably won't be for a while validating it is really a point in futility. If you want to use the new CSS features you're going to have to accept that your CSS isn't technically valid. Invalid CSS doesn't affect usability since users have no idea what CSS is much less if it's valid. As long as the results rendered in ...


6

In general, on the web with an international audience I think it can't be done, I'm not even sure you can do with a credit card number. As I see it, you have two choices (and because you didn't give any background information I have no idea if they are relevant for you): Limit your potential audience to a small group you have information on (example: if ...


6

Having valid HTML and/or CSS probably isn't a ranking factor. However, it is recommended that your code validate as it helps to ensure your content is properly crawled and indexed. Invalid HTML code can break a crawler just like it can break in a browser. As a result you should try your best to ensure your code is valid and easily read/crawled/interpreted by ...


5

All methods should be left in place for Google verification. Removing them will unverify your site. It isn't brought up on the main verification info page, but tacked on to the end of all the detail pages for the methods(meta, HTML, DNS, GAnalytics), eg: Don't delete the tag from the page, as this will cause your site to become unverified. I don't ...


4

You can validate HTML and CSS locally (and do a lot of other useful things) with the Web Developer Toolbar add-on for Firefox. It's also available for Google Chrome.


4

Keep in mind that CSS3 as well as HTML5 are still under development, so what is said to valid today can be no more tomorrow and vice-versa. But this is no reason to not use it if your concerns are usability and SEO. @John Conde gave a clear idea about that. You just need to make sure relative old browsers (there are many developers and entities dropping ...


3

I really think this would be a security issue if you can see it with JS or Flash. Actually, neither JS or Flash shouldn't offer access to any details of the user's PC except some very basic data about the OS, browser, screen resolution and such, things that you would actually need quite often. Who knows, might be possible with IE6 :D


3

There is no way to do it for free. There are non-free ways of doing it but they aren't cheap, in the US they require birth date and SSN, and outside the US you get a hodge podge of solutions. If you decide you want to spend the money check out Lexis Nexis, they are one of the premier online identification services and they have solutions for a number of ...


3

The best approach is to learn which invalid HTML is bad, and which invalid HTML does not matter. For example, forgetting to close a <div> tag is very bad, because your layout will almost certainly screw up in one or more browsers. However, using <br> instead of <br /> in XHTML does not matter - all browsers will interpret both as a line ...


3

One reason to test your site for valid HTML is that it ensures that the search engine spiders will be able to fully index and determine the meaning of your pages. If they cannot do so due to malformed HTML (which the major browsers may work around for historical reasons) then you are potentially limiting your search engine rankings. There has also been ...


3

When running the validator, you'll need to examine the errors it gives you on a case-by-case basis. Is validation important? To me, yes, it's very important. But is it a requirement? No. Things like using the same ID multiple times (instead of a class), putting block-level elements inside inline-level elements (usually these elements don't fit this way ...


3

I like low-tech: Doing a simple math problem works well. Enter what 4 + 4 adds up to: Then check server-side for 8. This is one I've used successfully on blogs using the Math Comment Spam Protection Plugin. Adding an extra field to your forms like: <input name="bots_only" value="" style="display: none" /> Usually, if bots_only is passed along ...


3

For websites, following the spirit of the rules is more important than getting a perfectly validating page. (Once the site works as intended, getting 100% validation may be a waste of effort.) Said another way: don't optimise for search engines - optimise for humans and ultimately an increased search position will follow. However, when it comes to RSS, ...


3

[There's an actual suggestion at the end of this, but there are also a bunch of problems with your entire question that I think have to be worked through, so bear with me.] There's no such thing as "unrealistically strict" here. The validator is not intended to be a liberal parser; it's a validator(obviously) and "valid" has a fixed technical definition. It ...


3

It depends on your doctype. In HTML 4 and 5, using named entities like &raquo; is perfectly valid. However, in XHTML you must use numbered entities like &#187; - most named entities are invalid, except for &quot;, &apos;, &lt;, &gt; and &amp;. Note: the alt tag is irrelevant in this case, it allows the same textual content as ...


3

I contacted Bing, as I couldn't get a clear reply for Bing. This is what they replied to me: Thank you for contacitng Bing Technical Support. This is (Name removed). Please allow me to address your issue regarding meta-tag verification. Specifically, you're asking if you should remove the meta-tag after verification. Apparently, you shouldn't ...


3

It probably has to do with the doctype. I suspect you're using XHTML. JavaScript Contains Characters Which Can Not Exist in XHTML. Raw < and & characters are not allowed except inside of CDATA Sections. See this page for more.


3

The W3C's validator tool offers cryptic error messages, but it actually gives you the answer to solve this. It complains about the line you've highlighted with the message: "The most common cause of this error is unencoded ampersands in URLs" This means you need to encode the ampersands in any scripts you include by using &amp; instead of &. So ...


2

I've also used simple natural language challenges, such as : A ________ is something with numbered pages surrounded by two covers. Hint: Rhymes with look The caveats of this approach is having to maintain a separate challenge/hint/answer file for each language that you want to support, but I'm leaning in this direction more and more as CAPTCHA images ...


2

Validation is useful because it can help you spot some hard-to-catch errors such as <input name=foo value=<?php echo htmlspecialchars($_GET['foo']); ?> /> or unpredictable browser behavior (for example, putting block elements in an a can sometimes break in ugly ways in Firefox).


2

In Debian/Ubuntu you can do: sudo apt-get install w3c-markup-validator This will get you the web interface. If you want to validate from the console, edit /usr/share/doc/w3c-markup-validator/examples/validate.pl and install libwebservice-validator-html-w3c-perl. Now you can run validate.pl with an URL to validate.



Only top voted, non community-wiki answers of a minimum length are eligible