HTML

Xeon SX

Well-Known Member
Joined
Feb 8, 2005
Messages
1,515
Location
London
I got this thing to do where I am given the code and I have to say which HTML syntax errors it contains. Help me out... ;)

<HTML>
<Head>
<TITLE>My first webpage</TITLE>
</Head>
<BODY BGColor = white>
<H1>Hello world</H2>


  1. <LI>First item
  2. Second item
    <LI>Last item

HTML stands for HyperText Markup Language.



It was invented by Tim Berners-Lee.

It is expected to be superseded by XML (the eXtensible Markup Language).



An HTML document consists of:

<dl>
<dt>The Head <dd>including the Title</dd>
<dt>The Body <dd>which can include Lists, Paragraphs, Tables etc.
 
<HTML> needs a closing tag of </HTML>

<BODY BGColor = white> should be <BODY BGColor="white">

<H1>Hello world</H2> should be <H1>Hello world</H1>

All of your <LI> tags need to be closed with </LI>

Hey man, am I doing your homework? There are a few more errors so give it shot on fixing them. Also, keep in mind that this is old school HTML and that a lot people have moved to CSS.

Here's an additional resource for you to look at. http://www.w3schools.com/

I didn't want to completely do your homework for you because you will never learn anything that way.
 
well the thing is I know that most tags must be in upper case and that for values that should be quotation marks. Oly I am not sure whether I am talking about syntax of HTML or XHTML :(

I have been to this page http://www.w3.org/TR/html401/ its about syntax of HTML and about HTML in general but hey I dont have 2 weeks to read it all :?
 
HTML stands for HyperText Markup Language.



It was invented by Tim Berners-Lee.

It is expected to be superseded by XML (the eXtensible Markup Language).



An HTML document consists of:

<dl>
<dt>The Head <dd>including the Title</dd>
<dt>The Body <dd>which can include Lists, Paragraphs, Tables etc.

Your

tags should go at the beginning of any block of text. That is, "

HTML stands for...". If you want to enter a new line, add a
tag to the end. P tags need to be closed, as well as <html> and <body> tags.

The BGColor="white" is redundant, as it's always white to begin with anyway.
 
is it correct to nest tags like so "First item" I am sure it isnt in XHTML but how about just HTML?
 
we were never told this thing and 1 day, assignemnt with this question just like that...
 
Xeon SX said:
well the thing is I know that most tags must be in upper case

no, tags aren't case sensitive.
 
Code:
<html>
	<head>
		<title>My first webpage</title>
	</head>
	<body bgcolor="white">
		<h1>Hello world</h1>
		[list=1]
			[*][b][i]First item[/i][/b]
			[*]Second item
			[*]Last item
		[/list]
		HTML stands for [i]HyperText Markup Language[/i].
		


			It was invented by Tim Berners-Lee.

			It is expected to be superseded by XML (the [i]eXtensible Markup Language[i]).

			An HTML document consists of:
			<dl>
				<dt>The Head</dt>
				<dd>Including the Title</dt>
				<dt>The Body</dt>
				<dd>which can include Lists, Paragraphs, Tables etc.</dd>
			</dl>
		</p>
	</body>
</html>

HTML Levels :
Level 1 #FFFFFF
Level 2 #FF0000
Level 3 #00FF00
Level 4 #0000FF
Level 5 #FFFF00
Level 6 #00FFFF
Level 7 #FF00FF

ColoredMarkup.gif


Some Notes On The Code :
  • First in last out, The push pop method.
    If you open the bold tag first, you must close it last.
    For example :
    FirstInLastOut.gif

    First in last out.
  • Not all tags require a closing tag, but if they do not require a closing tag you must place a forward slash before the closing wicket. For example the BR tag has no closer, so you would use the tag like so :

    .
  • Tags them selfs are case insensitive.
  • List Item, aka the LI tag, does not require a closing tag, unless your programing for HTML 4.01.
  • Indentation in your code will help debug your code, and also show your self, and other people how the flow works. I would recomend the use of tabs for indentation. But when you do publish your code, remove the indentation so as not to comsume more bandwith then needed.
 
^^^ oh my, you have a little too much free time dude :lol:

and the "first in last out" principle doesn't have to followed, but it is good practice. The code will still work regardless of whether you follow it or not, so to say tags "must" be closed in that order is false.
 
On the contrary, your breaking the standard. Some bowsers that are totaly complyent will break once they see that string. IE Does not follow the standard. Firefox follows the standard to an extent. As for me having to much time on my hands. No, just some free time between F1 and LFS : F1. :) Then what ever programing I have to do for that day. Speaking of that, I wonder if DX10 is done installing ... yep. I want to have the F1 over lay in LFS.
 
Dygear said:
On the contrary, your breaking the standard. Some bowsers that are totaly complyent will break once they see that string. IE Does not follow the standard. Firefox follows the standard to an extent.

Yes, it's good to follow like i said, but I've never seen a browser "break" over it and I do web design for a living and often times I update sites that other people have built, which means I have to clean up a lot of code that others have made. Most of the time the code is extremely messy, but some how or another the site still works.
 
I will add that most school teachers don't know what they're talking about in technology courses.

Every computer teacher in my HS had no idea what they were doing. Me and some friends would always talk about stupid things our teachers did or said. We could have taught the classes ourselves :D
 
matt_shaw said:
Your teacher sucks :lol:

No. u suck. :p :lol:

jeffy777 said:
Xeon SX said:
well the thing is I know that most tags must be in upper case

no, tags aren't case sensitive.

That depends on the language you're writing. HTML isn't case sensitive but XHTML on the other hand is. XHTML disallows the use of upcase characters in tags.
 
Top