HTML newbie question.

They have: 2 posts

Joined: Apr 2006

I just started to follow the tutorials at W3 to learn HTML. But im noticing alot of things dont seem to really do anything and getting confused on some of it. For example..

a dozen is
twenty
twelve
pieces

Why not just put

A dozen is twenty twelve pieces

and for Preformatted text, why use when you could just put

 and space what your writing with enter as you need to ?

Also, I dont see where having  changes anything, rather than just writing the text you want in the 

Same for   and  . I see no changes in the html when I remove those

Sorry if a dumb question, but I just started today  :)


Edit: Oh also, im confused on "Computer Output" Tags shown here 
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_computeroutput

It says theyre used to show computer/programming code. I assume without those tags, if you were to write in some comp/programming code that it would mess up the HTML? if so, it doesnt say what the difference between each tag is, other than a different font.
Or is that all those tags are? fonts? 
Busy's picture

He has: 6,151 posts

Joined: May 2001

the (with their respect end tags) are browser related tags.

The tag tells the browser which format (although html is not a language as such)
The section holds the browser related tags
The tag gives the search engines keywords etc
the tag gives the page a title (look up very top in blue), also title for bookmarks

The is the content section which is displayed on the page
The ends this section
The ends the page

I'm trying not to get to much into a tutorial here as it will take pages, so again in brief

The is a paragraph, which is two line spacings
The (or in XHTML) is a line break, which is one new line

The

tags display in new times roman as is written, this includes line spacing and gaps, using the will get the same line spacing but not the extra spacing or offset etc if used, plus the font is default unless declared elsewhere

the is strike through which is the older HTML, XHTML is phasing out the single letter tags, so becomes (Don't ask me why I personally think it's a stupid move)

Depending on the browser, if you leave out or remove certain tags the browser will go into guess mode and think you are using frontpage (personal joke) so guesses what to do, IE is worse (or best however you want to look at it) for this but in a bigger site a missing end tag for example can cause big problems.

On that site, look at the style of font, the easiest ones to spot the differences on are and

, these are used for displaying code as mentioned in tutorial type sites, you'd use italic <em> (<i>) for general formatted text.
An example of the <code> tag:

To apply a variable in PHP you'd use something like the following:
<code>$variable = "value";

The above would display $variable = "value"; in a computer text (no thrills text)

Welcome to HTML, I hope I explained it so you can understand it

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.