Pages

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! 

Public service announcement aside, let's get down to the nitty-gritty historitty (yeah, I did that) of the wonderful language we call HTML. As I explained in the last post on the subject, HTML stands ofr Hypertext Mark-up Language -- essentially, a fancy way to say it's a coding language with stylish text and links to other pages.

It was created in 1990 by Tim Berners-Lee, an intelligent man who looked at the work of his fellow scientists, and realized it would be easier if they could all share their work on the Internet with pages that linked to other pages (with relative information). Even better, these pages could be stylized so as to make reading easier, like in a book, or magazine.

Internet browsers, such as Mozilla Firefox, or Internet Explorer, or Google Chrome, all use HTML. Usually it is conjunction with another popular language, CSS, or Cascading Style Sheets. Don't worry about that right now; we will gradually work into it! Just know that HTML is for function, and CSS is for style -- not the other way around!

To start writing HTML, you just need a text editor, such as Notepad. Editors like Notepad are valuable to coding because they do not interfere with the code's text, unlike Microsoft Word and other word processors. You don't even need to be online, or connected to the internet at all, to code HTML. After you've saved the text file with the code, you can open it using your browser (via "File" -> "Open") to see what it would look like as a webpage.

Neat, huh?


Keep an eye for the next post on HTML, which will explain more in-depth the different parts of HTML coding!

No comments:

Post a Comment