PDA

View Full Version : Can anyone recommend good HTML code books to clean up my websites code



peaceandkarma
08-28-2011, 10:22 AM
Hi, my website seems to have a lot of errors within its HTML code. This is due to using my website hosts templates which have a number of errors within them. The good thing is that my website is fully customisable and I'm looking to remove them by learning basic HTML coding myself and rewriting the code to the correct error free code.
A problem I have at the moment is that my traffic seems to come solely from Google and I'm connecting my lack of traffic from other search engines to the HTML errors on my website.
Does anyone know of any good HTML code books that will help me clean up my code. I would rather clean up the code myself as I feel if I'm a website owner its really part of the job to know HTML code. I would appreciate any answers.

Kind regards Warren.

williamc
08-28-2011, 01:30 PM
Start here: http://validator.w3.org/ that will give you a good bit of insight on any broken code on your pages, and tips how they may be fixed by seeing what was found wrong.

LD
08-28-2011, 05:06 PM
Start here: http://validator.w3.org/ that will give you a good bit of insight on any broken code on your pages, and tips how they may be fixed by seeing what was found wrong.

When you mentioned your tutorial contest I started writing a tutorial but got side tracked and it ended up as a satirical argument on just that, W3C compliance. If I find a proper venue for posting it I will post some of it.

Sorry, I digress. The main thing was, that I tried for hours to get the code right even though a specific test page rendered fine in the test browsers. However, continuing on, when I just about had all errors fixed, a new bunch errors came into play. I gave up 3 hours later after choking down a cold dinner and the best I could do was 9 errors. I think all are JavaScript errors but the page reneders fine in the 4 browsers I tested it on. But as tiring and frustrating as the experience was, I think I learned a thing or two. :)

weegillis
08-28-2011, 05:45 PM
Sadly, what you're going to find is that the code over which you have editorial control is limited, and that the hosting provider may well be adding code of their own when it leaves their servers. Have you checked for this in generated code (Inspector)?

If the above is in fact the case, then many of the errors may be in that code, and even when you clean up your portion, there will be theirs remaining unfixed.

The only real way to have complete control over your code is to only use your code. As soon as third party code comes into play there will be a myriad of possible errors that turn up in a validator, but that do not trigger errors in the rendered page. Invalid code works too, in most cases. Sometimes the developers just can't work around a particular validation issue so opt to ignore it, or find some way to justify it. One of those 'user check' situations.

Building a website with a host provided 'builder' is the surest way to give up control over your website. If you remount your own crisp pages and the host is still tacking on their goodies as the pages leave the server then you have no choice but change providers, or upgrade to a paid hosting package. Nothing is ever free.

peaceandkarma
08-28-2011, 06:40 PM
Thank you for all your replies, I'll have a crack at cleaning it all up and I could host the site myself in a few years time so I'll keep my options open.

Kind regards Warren.

chrisJumbo
08-29-2011, 04:14 PM
Note: This is not an affiliate link. I have purchased quite a few of Sitepoint's books.

http://products.sitepoint.com/?tag=&filters[tag][]=html&filters[difficulty]=&simpleform_submit_marker=showme

"Building Your Own Website the Right Way" - 3rd edition is probably a good place to start.
Also "The CSS Anthology: 101 Essential Tips, Tricks & Hacks, 3rd Edition"

Are you near a Borders? They are going out of business and you may find some good books at 50% to 75% off.

cd :O)

morestar
08-29-2011, 04:15 PM
Does anyone know of any good HTML code books that will help me clean up my code. I would rather clean up the code myself as I feel if I'm a website owner its really part of the job to know HTML code. I would appreciate any answers.

Kind regards Warren.

I would really follow the advice of visiting the W3C Validator - unless you want to purchase a book to add to your book-shelf, but be aware you'll have to throw it out in 5 years as it'll probably be quite out-dated.

For every error you find, paste it into Google and find out how to fix it - I've yet to come across an error that cannot be fixed - although sometimes it takes days to figure out - you can.

;)

cbosleeds
08-29-2011, 04:20 PM
Just going back the the original question here. If its a lack of visitors that's the issue, then the source code may well be contributing somewhat if its utter spaghetti but it is only one of about 200 factors so I'm sceptical that this is the cause of a lack of traffic. Although, it may be the cause of a lack of conversions if there are faults that show up client-side.

An internet marketer would be able to look and tell you. The bottom line though really is that if you're running an online business, then its your job to run the business and grow the business rather than tinker with the code unless you really do have world enough and time to practice and learn. Run it by an internet marketer, let them look at the code but also keyword and competitor analysis and positions as well and they'll be better placed to identify the missing peice in the jigsaw. Search engine positions aren't often noticeably harmed by a few coding errors although they can be affected more by mountains of extraneous code which buries the content into obscurity from an SEs perspective.

First off, put a link to your website on here and I'm sure a few people will give it the once over, and you might get to the source of your traffic issues more quickly.

felix.renegade
08-29-2011, 04:47 PM
You may want to start with eBooks. That is how I learnt HTML a few years ago. This will allow you to test a few of them and when you find the one you are comfortable with, then you can buy. Go to wowebook.com, search for and download eBooks. This is not an endorsement. I have gotten a few books from there...

dgswilson
08-29-2011, 04:51 PM
my traffic seems to come solely from Google and I'm connecting my lack of traffic from other search engines to the HTML errors on my website

IMO probably not. More people use Google-Search than anything else. Once you've followed advice and seen what W3C shows you, copy css and html page on to your PC and play with it, opening up with browser to check changes. Any specific html question you have you can type into search and get answers.

Clarrie
08-29-2011, 05:21 PM
cbosleeds has a good point about invalid code probably not being the problem of reduced traffic from the other search engines - particularly as you're in the UK - UK search market share is dominated by Google, and the others only get a tiny slice of the cake anyway - about 2 months ago we did a survey of some of the heavier traffic sites we look after, ones that are ranked well on Google and on Yahoo/Bing, and the average for organic search engine driven traffic was 88% Google, 12% the rest, so just be thankful you're getting traffic from Google!

Most search engines are pretty tolerant of code with errors in it unless it's really broken, but I'm always in favour of cleaning up errors if possible, so to come back to things to help you...

Most people here have pointed to the W3C site, but there are also browser based tools that help you identify problems with your existing code:
Opera with the optional debug tools (that link out to W3C validation tools etc) plus Dragonfly
Firefox with the HTMLValidator Add-in + Firebug

But for me the best HTML reference is http://www.w3schools.com/

Covers pretty much every technology as well as HTML. Searchable, continuously updated to latest specs (and browser compatibility), with good explanations and code examples and it's FREE! Stacks of tutorials as well if you need them.

mikmik
08-29-2011, 06:09 PM
Sorry, I digress. The main thing was, that I tried for hours to get the code right even though a specific test page rendered fine in the test browsers. However, continuing on, when I just about had all errors fixed, a new bunch errors came into play. I gave up 3 hours later after choking down a cold dinner and the best I could do was 9 errors. I think all are JavaScript errors but the page reneders fine in the 4 browsers I tested it on. But as tiring and frustrating as the experience was, I think I learned a thing or two. :)
Yes, you definitely learn. Have you checked out HtmlTidy (http://www.w3.org/People/Raggett/tidy/)? It cleans up your code where possible and lists the other problems by line for your attention. I haven't used it for a while, but it's really good and it is free!

In ant event, the parsing of your document by the validator can be sort of side tracked, like two wrongs make a right(purely analogy), so that when one error is fixed, others become apparent. It happens all the time - nothing like thinking, "Hey, almost there!" only to get another bunch returned. (LOL, I used to think, "Hey, why were these okay a few minutes ago!!")

LD
08-29-2011, 07:05 PM
Yes, you definitely learn. Have you checked out HtmlTidy (http://www.w3.org/People/Raggett/tidy/)? It cleans up your code where possible and lists the other problems by line for your attention.
I will check it out for sure.


In ant event, the parsing of your document by the validator can be sort of side tracked, like two wrongs make a right(purely analogy), so that when one error is fixed, others become apparent.

Exactly - when I was almost done - bang - another 30 errors/warnings appeared! And you are right - those errors were ok at last scan - WTF?? :)

weegillis
08-29-2011, 08:14 PM
Best advice I can give is don't be alarmed when the validator spits out 56 errors. One open tag can cause the whole page to break. Usually, the more errors, the closer to the top of the code listing to look for the most glaring mistake or omission. Fix one thing at a time, starting at the top, and revalidate. Work down the page, and fix another error. Re-validate. In many cases it's one or two or three errors that cause the whole cascade to crash.

Rod Abbotson
08-30-2011, 01:01 AM
Hi Warren,
I had to do this several years ago and found that WC3 schools worked well...I managed to get all my website validating with no errors in XHTML 1.0 Strict

I since use CS lite (free validation checking program for editing my pages so I can check for errors before uploading them each time.

It require patience, especially if you have many pages..but satisfying when completed...many many people on this forum have an opinion that correct coding validation doesn't matter..... well in my case once I found I could have "no errors" I cannot tolerate any errors!! Also it has improved y business from my website above all my local competitors...none of whose page validate at all!

One more point if you have a "free" hosting as mentioned earlier in this thread there will be ads etc for the hosting service and they may well have errors..I had this problem with a free hosted site...even though I could correct the errors I couldnt overide the host and correct them...very annoying so I basically paid for the hosting..... Go Daddy have some very economical hosting options and since I have been using them I have had better customers service than 4 other hosts I was using previously....

Good luck

Rod

nickoran
08-30-2011, 04:15 AM
personally I use a HTML validator plugin for firefox to check for errors that might get fixed, but its certainly not always possible.
a site you might be interested in is http://diveintohtml5.org/ which Ive found really good for getting into html5 if your updating a current site.

SnerdeyWebs
08-30-2011, 12:12 PM
Ahh.. ever check out how Google, Yahoo and others fair in the W3C Validation reports? LOL

LD
08-30-2011, 12:19 PM
Ahh.. ever check out how Google, Yahoo and others fair in the W3C Validation reports? LOL

Yup - Big G has upwards of 40-50 errors if I recall correctly.

weegillis
08-30-2011, 01:05 PM
Ahh.. ever check out how Google, Yahoo and others fair in the W3C Validation reports? LOL

Yes, but remember the part about 'user checks'? And the part about one error causing a cascade of errors? We've been down the road of the big sites not validating, many times. It doesn't mean they are ignoring the specifications or the need for valid markup, they are building largely valid coded pages. Theirs' are sites that definitely fit under the 'user check and justify' umbrella. A small site, built of native HTML does not have this 'safe harbour,' nor should it be in need of it.

astro
08-30-2011, 04:50 PM
Any chance of a link here? I am curious enough to take a look. Then maybe more constructive opinions can be offered.

I have never been a huge fan of host generated web pages and web building software. (Even though I offer them to my own hosting clients on my hosting site) they serve a valuable purpose for those who have no idea what so ever about web sites, but want an Internet presence. But if a site is to be commercial and ranking high, then build it from scratch. There is excellent software out there which is easy to learn. Just use the manual! Don't do the usual male thing, ignore the instructions, play about a bit then give up whilst cursing the stupid waste of cash, dumb software. :)

To prove a point to myself a while back I used the software I offer to build a site. I failed to prove the point! The template was excellent (I loved it and still do) but the software was limiting in what I wanted to achieve, when I complained to the provider it was explained I was only feeling limited because I knew HTML Which is true. In the end I downloaded the site from the server to my computer and tweaked it with my own software. But the net result of that is I can never go back to the server software again.

To sum up, if you want your site to work on a commercial basis, then I suggest you get professional help. More than enough excellent people here who would love to oblige. Just not me please!

/astro