Forum Moderators: open
From what Im told (Im not directly working on it) its doing it in <table>, <td>, Meta Tags and some other places.
Does anyone know of this type of thing having a serious effect on how Browsers show your page and how Search Engines read your page/meta tags/links and such?
Im sorry Im not more specific, but havent had time to dig into exactly what all is being changed yet (I was just told some 30 min ago).
Thanks to anyone with some insight.
Hoping be useful,
Herenvardö
Why?
I believe that time wasted in maintenance dealing with issues caused by sloppy code far outweigh any benefits. How much will it cost you if you have to spend hours fixing a strange bug in a browser you haven't tested? Or if you come back to the code some time later, and misunderstand something you did? Or even if you change your mind later? You do use a version control system, don't you?
You can reduce page size far more effectively with other tricks:
- Use the best compression mechanism for your images.
- Use GZIP compression to serve your pages.
- Eliminate unneccessary table layouts.
Trust me, good code is the way to go, but in the meantime we have probably 30% of our users being upset by our page load times and a mountain of other work.
In lieu of correcting all of the code (which we'd like to do over time) we are trying to get some bang for our buck using compression.
Any additional ideas or tool options for this would be welcome.
Thanks...
Meta tags have no value anyhow so that does not matter.
Not really true. I use the description meta tag on the front page of an otherwise poorly-optimized website, and Google responds by using the description as the link abstract. Exactly the behaviour I'd hoped for, and a hell of a lot easier than rearranging the page and menus to ensure that the first few lines of text were highly descriptive.
(I don't do SEO -- this is a rarely used personal web-database)
Thanks Herenvardo for your insight and g1smd for the validator - been out of the office so will take a look at that later today.
It appears that my worries were for nothing then and that the " arent really needed (100% of the time). I never thought they mattered, but assuming such a thing and having Browsers blow up or SE's curse at you isnt something I wanted to have happen :).
In HTML 4, every attribute value that contains virtually anything other than just A to Z and 0 to 9 must be in quotes. Certainly anything with a / or a # or a space in it MUST always be quoted.
.
From: [w3.org...]
>> In certain cases, authors may specify the value of an attribute without any quotation marks. The attribute value may only contain letters (a-z and A-Z), digits (0-9), hyphens (ASCII decimal 45), periods (ASCII decimal 46), underscores (ASCII decimal 95), and colons (ASCII decimal 58). We recommend using quotation marks even when it is possible to eliminate them.
Meta tags have no value anyhow so that does not matter.
This topic has been beaten to death but I don't know if it's truly dead. :-) I hear the above over and over, from many sources, but guess what I found today?
I was pointed to a site by someone as an example. The main page consisted of a Flash header with navigation (bad), a mission statement composed of an image (worse,) and no other textual content on the page other than the four text links at the bottom (worst.)
Thinking of this thread, I promptly Googled the URL. To my surprise, there was a full text description on Google, but it was nowhere on the page, not even in the ALT tags of the image or description/comments generated by Flash's publish settings (which this developer used right out of the box.)
But. It was a word-for-word match on the META description tag.
So once again, I'm on the fence about using or not using meta tags. When in doubt, use them, quote them, do everything you know of that's specified anywhere.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
For your page to actually be valid you MUST declare the character encoding (lets the browser know whether to use A to Z letters (latin), or Chinese, Japanese, Thai, or Arabic script, or some other character set) used for the page, with something like:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
There are also other schemes such as UTF-8 and many others.
It is also a good idea to declare what human language the page is in, using:
<meta http-equiv="Content-Language" content="EN-GB">
The language and country codes come from ISO 4217 and ISO 3166. This is useful for online translation tools as well. Change the "en" and "gb" to whatever language and country you need.
You need a <title> element for the page:
<title> Your Title Here </title>
This is displayed at the top of the browser window, and stored as the name of the bookmark if someone bookmarks the page URL in their browser. Most importantly, it is the <title> tag that is indexed and displayed by search engines in the search results page (SERPs).
You need the meta description tag, as this is very important for search engines, and it is useful but not vital to have a meta keywords tag:
<meta name="Description" content=" Your Description Here. ">
<meta name="Keywords" content=" your, keyword, list, here ">
Most search engines do obey the robots meta tag. The default robots action is index, follow (index the page, follow all outbound links) so if you want something else (3 possibilities) then add the robots tag to the page in question. If you want to exclude whole directories then use the robots.txt file for this instead of marking every HTML file with the tag.
<meta name="robots" content="noindex,follow">
The last parts of your header should have your links to external style sheets and external javascript files:
Use this if the stylesheet is for all browsers:
<link type="text/css" rel="stylesheet" src="/path/file.css">
Use this for style sheet that you want to hide from older browsers, as older browsers often crash on seeing CSS:
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"> @import url(/path/file.css); </style>
Use this for the javascript:
<script type="text/javascript" language="javascript" src="/path/file.js"></script>
End the header with this:
</head>
<body>
and then continue with the body page code.
It is as simple as that.
Code within the page:
I use: <a href="somepage.html" title="some text here"></a> for links.
I use <img src="somefile.png" alt="some text"> for images.
Headings are done with <hx></hx> tags, properly used from <h1></h1> downwards.
Your document should begin with a!DOCTYPE (this tells the browser what sort of HTML is in the file) followed by the <html> and <head> tags:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
Just FYI, the doctype declaration is useless without a url:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
The DOCTYPE should have a full URL, yes, but that can cause the layout to change. I always recommend a new user to use the "short" DOCTYPE, and that is enough to get the pages through the validator. Most new users have a lot of code errors: nesting problems, invalid attributes or values, and so on. The first priority must be to tidy the code so that is at least valid. When the user becomes more experienced, then that is the time to study, in depth, the differences between strict and quirks mode in various browsers. I wouldn't foist that on to a new user right away.