Pages

Showing posts with label lesson. Show all posts
Showing posts with label lesson. Show all posts

Wednesday, September 26, 2012

Understanding HTML and its Importance

In my last lesson on HTML, I covered some basic tags by which to code a webpage. Here's an example of a simple page code using tags from that post:


<html>
                <h1>Example page</h1>
                <br />
                <p> This is an example page. A clickable link can be found <a href="code-buddy.blogspot.com">here!</a>
</html>

This is incredibly simple, and would not pass as a real website today, but it does show the basic way in which HTML really works. Tags are nested inside other tags, but that's not all; while not quite necessary, I have used separate lines and indentation to make it easy to read our code.

I do this because anyone (including myself) who will inevitably come along to alter the code for any reason will have a tougher time deciphering it if it looks like this:

<html><h1>Example page</h1><br /><p>This is an example page. A clickable link can be found <a href="code-buddy.blogspot.com">here!</a></html>

While its certainly not impossible to read that particular piece of code, keep in mind that coding can easily span hundreds of lines, very quickly. Many decent pages have so many lines of code it would be a screwy task to even try counting them all!

So, the point is, keep your code clean and clear, for both our sake, and yours!