HTML Basics

Talk about HTML resources, styles etc.
Post Reply
User avatar
JimBb
Deep Thought
Posts: 1964
Joined: Sun Nov 16, 2003 8:19 pm
Location: Dilbeek, Belgium
Contact:

HTML Basics

Post by JimBb » Sun Jan 02, 2005 1:56 pm

What is HTML? What is an HTML file? And what is an HTM file?
Well, HTML is a text-based "language" that tells a browser how to display things. So no compiler or interpreter is needed to read or create the files, a simple text editor like Notepad will do. The only difference is that if you use Notepad you have to take care not to name your file (somefilename).TXT, but (somefilename).HTM or (somefilename).HTML. That's right, you can choose.

Can you really choose? Well, let's say it depends. If you have only one "mydog" file, calling it mydog.htm or mydog.html doesn't make any difference. But you can have index.html ànd index.htm on your site... If you link to the filename there's no problem, but if you don't then you depend on the webserver-software you happen to be using. There will be an order, so it may be so that on one server the html file will be shown as the default, on the other the htm file.
Basically it all comes down to being organised. You shouldn't have two files with the same name, full stop. Even if they have a different extension.

And what about the filename itself, regardless of the extension? Most modern browsers and webservers will forgive you, but you shouldn't really use spaces, dots, commas, and other odd characters in any filename on a webserver. Just a-z, 0-1, - or _ and nothing more. What about UPPER or lowercase? Up to you. Just remember that for a webserver there is a difference between Mydog.htm and mydog.htm and MYDOG.HTM and mydog.HTM, they are all different files. If you want to make life easy for yourself, just use always lowercase, that way you just need to remember the filename, and not it's case.

Okay then, what should be in an HTML file? The content of course is up to you, but you should follow a basic structure:

Code: Select all

<html>
  <head>
    <title>This is the title of your page</title>

  </head>
  <body>

  </body>
</html>
Notice how I indented. That's not a requirement, theoretically you can create a perfect HTML page on one line. Extremely hard to decipher and edit by you, but there's no HTML rule forbidding you to do that.
But using an indent, just like in programming, helps you to see which parts belong together, they will show some kind of hierarchy.

So, the parts...
<html>...</html> indicates that those are the boundaries of your page. There should be nothing before <html>, and nothing behind </html>. One exception: the "Doctype" declaration - but I wouldn't worry about that now. Everything else, every HTML tag, every script, everything should be between those two boundaries.

Inside those boundaries you notice two marjor blocks:
<head>...</head> This has nothing to do with a heading, but everything with "invisible information about your page". Keywords, some scripts, and other information goes here.

<body>...</body> This container, err, contains the visible information. Text, images, lines, colors, all of that goes here. More info in this thread about the Body-tag.

<title>...</title> Look at the top of this window. In the title-bar of your browser you read "Gostats.com free hit counters :: View Topic - HTML Basics". That's the title of this page. Don't confuse this with a title on the page itself: since it is in the Head-section it belongs to the invisible info. Huh? But I can see it? Yes, but not on the page itself. Your browser shows it in the title bar, and if you add this page to your favourites the Title-tag is used as well. Search-engines will also use this title-tag, so be very careful and pick the right words. Just for fun search the web and see how many people have a page called New Page 1 or other irrelevant info.

One last thing: of all the elements you see in this basic structure there should be exactly one, no more, no less. So no two <body> tags, as so often happens when people copy-and-paste scripts without thinking.

Jim

WayneHeidtman
web counter beginner
Posts: 1
Joined: Fri Jul 30, 2010 2:41 pm

Re: HTML Basics

Post by WayneHeidtman » Fri Jul 30, 2010 2:45 pm

Thanks Jim this is helping me understand html a bit better. But I have a question. What is the difference between .html and .htm? Are they the same thing? Thanks for your help.
A saying usually [url=http://topseotips.org/]top seo tips[/url] are and consequently [url=http://fatburningfurnace.tv/]fat burning furnace[/url] could actually help all of us lose weight quick simply apply it by working with [url=http://lilykeywest.com/the-diet-solution-program-review]the diet solution[/url] additionally [url=http://kellyacollins.com/tinnitus-miracle-system-review]tinnitus miracle[/url]. Whats your opinion.

mar
calculator
Posts: 41
Joined: Wed Jun 09, 2010 5:25 pm

Re: HTML Basics

Post by mar » Sat Jul 31, 2010 5:52 am

You may want to check this link http://www.sightspecific.com/~mosh/WWW_FAQ/ext.html regarding html vs. htm

Mar.

ake100
web counter beginner
Posts: 4
Joined: Mon Dec 20, 2010 6:14 am
Contact:

Re: HTML Basics

Post by ake100 » Mon Dec 20, 2010 6:28 am

thx for your knowledge
i understand HTML more.

alferied
web counter beginner
Posts: 1
Joined: Mon Jan 10, 2011 6:34 pm
Contact:

Re: HTML Basics

Post by alferied » Wed Jan 12, 2011 4:38 pm

Thank for the informative post.

christineb1979
web counter beginner
Posts: 1
Joined: Mon Jan 17, 2011 9:28 pm
Location: Silver Spring, MD
Contact:

Re: HTML Basics

Post by christineb1979 » Mon Jan 17, 2011 9:46 pm

Thanks for this information.

rachel12
web counter beginner
Posts: 2
Joined: Fri Jan 21, 2011 5:48 am

Re: HTML Basics

Post by rachel12 » Fri Jan 21, 2011 5:52 am

Wow. This is very informative. This help me to understand html best. Thanks for sharing such informative knowledge with us. :)
rachel

James72
web counter beginner
Posts: 1
Joined: Fri Feb 18, 2011 3:51 pm

Re: HTML Basics

Post by James72 » Fri Feb 18, 2011 4:03 pm

Thanks, that's good to know!

catheleen
web counter beginner
Posts: 1
Joined: Wed Apr 20, 2011 2:49 am

Re: HTML Basics

Post by catheleen » Tue Apr 26, 2011 5:19 am

What is the easiest way to validate DTD standards when altering an html document? I find that most html documents differ according to document Type Definitions. But does that mean that you have to go look on the W3 site every time you make an alteration to someone else's doc's or do you just have to get into the habit of "remembering" what the rules are for each standard??

nicnac03
web counter beginner
Posts: 2
Joined: Wed Jul 13, 2011 1:28 pm
Contact:

Re: HTML Basics

Post by nicnac03 » Wed Jul 13, 2011 1:31 pm

You forgot to mention that it stands for hyper text markup language. :)
[url=http://www.cheap-baby-stuff.org]cheap baby stuff[/url]


Post Reply