Jump to content

My first file ....


RivkaS

Recommended Posts

Dear all,I have stuggled to get a HTML-document together but there are some points that I don't understand, have not learned yet or not found in the tutorials. Here is what I have written:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html xmlns:o="urn:schemas-microsoft-com:office:office"xmlns:w="urn:schemas-microsoft-com:office:word"xmlns="http://www.w3.org/TR/REC-html40"><html><head><title>Clothes</title></head><body bgcolor="#FFCC99"><b><font size="7"; font face="Comic Sans MS"; color=#"990000"><p align="center">Clothes</p></font></b></body></html>
Questions:Which attributes are going into the "body"-tag?Which attributes or how many can I add to the "font"-tag?Which attributes go into the "paragraph"-tag?Do I have to use header-tags (h1 - h6) if I use font-size?Thank you for your answers.
Link to comment
Share on other sites

Which attributes are going into the "body"-tag?There isn't much attribute that go into the body tag. Maybe onload for javascript functions.Which attributes or how many can I add to the "font"-tag?The font tag is deprecated (shouldn't be used anymore), instead use styles (see css fonts).Which attributes go into the "paragraph"-tag?There's a couple attributes that can go in the p tag, style, class, id...Do I have to use header-tags (h1 - h6) if I use font-size?It is best to use header tags and then use styles (css) to resize them and change their colour to your liking.

Link to comment
Share on other sites

Somewhere I read that it is a good idea to learn HTML for the basics and so this is what I am doing. I don't want to jump things because I fear that later on I will not understand things that I see... and I have enough of click-through-programs and HTML-converters - that's not art.... I want to know what I am doing. (yes, I am impossibly old fashioned :) )

Link to comment
Share on other sites

I agree. It is important to learn HTML before you move on to XHTML and such... I sometimes work on projects created a couple years ago by someone else and back then font tags and stuff like that were very common but time changes.

Link to comment
Share on other sites

This is what I think and since I would like to work with this one day I would like to know also the basics thoroughly.

Link to comment
Share on other sites

I wouldn't even go on to XHTML. Speaking of which, you have xhtml things mixed in that code (try validating it).
i wouldn't go onto the xml part of xhtml, but basic things you should be doing already (always closing singe tags for instance, like break (<br />))
Link to comment
Share on other sites

I wouldn't even go on to XHTML. Speaking of which, you have xhtml things mixed in that code (try validating it).
I have overlooked this post - can you show me, which tags I have mixed?
Link to comment
Share on other sites

Guest FirefoxRocks

Ok, this looks like one of this Microsoft Word generated documents. Or you have used a Microsoft program to convert it to XHTML or something.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>Clothes</title></head><body bgcolor="#FFCC99"><b><font size="7"; font face="Comic Sans MS"; color=#"990000"><p align="center">Clothes</p></font></b></body></html>

I removed the XHTML part from your code. Also, this document is completely invalid. For example, you can't have a paragraph inside <b> and <font>, you must have those inside of your paragraph. Also, you have 2 <html> tags in there.I would recommend my easy to use tutorial at http://portal.trap17.com/wdl/. Yes I know it is XHTML, but it is also HTML-compatible which means that you can use that to help you learn HTML better too. Hope it helps! :)

Link to comment
Share on other sites

...
...<body bgcolor="#FFCC99"><b><font size="7"; font face="Comic Sans MS"; color=#"990000"><p align="center">Clothes</p></font></b></body>...

For example, you can't have a paragraph inside <b> and <font>, you must have those inside of your paragraph. Also, you have 2 <html> tags in there.

I think this is getting close to answering my question.A - can you express this differently? I don't understand it.Do I understand that right, that <b> and <font> have to go into the paragraph-tag?(For your link - sorry I won't use it, it would only confuse me completely to read different things at the moment.)
Link to comment
Share on other sites

Yes, that is right. The <b> and <font> tags are inline tags, and generally cannot contain block elements (such as <p> and <div>). So, it would be correct to say

<p><font><b>Text</b></font></p>

but incorrect to say

<b><font><p>Text</p></font></b>

And the <html> element is the root element, everything (except the document type declaration) has to go inside of it, and there can only be one of it. However, you seem to have placed one underneath another. Remove the first one, the attribute information is unneeded.

Link to comment
Share on other sites

Next try: Like this?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">[color="#000080"]<html>[/color][color="#008000"]<head>[/color]<title>Clothes</title>[color="#008000"]</head>[/color][color="#A0522D"]<body bgcolor="#FFCC99">[/color][color="#FF0000"]<p align="center">[/color][color="#9932CC"]<b>[/color][color="#4169E1"]<font size="7"; font face="Comic Sans MS"; color=#"990000">[/color]Clothes[color="#4169E1"]</font>[/color][color="#9932CC"]</b>[/color][color="#FF0000"]</p>[/color][color="#A0522D"]</body>[/color][color="#000080"]</html>[/color]

Link to comment
Share on other sites

That looks good, except get rid of the semicolons and the second "font" in the <font> tag, and put the hash inside the quotation marks.

<font size="7" face="Comic Sans MS" color="#990000">

Link to comment
Share on other sites

And don't forget quotation marks! <tagname k1="v1" k2="v2" k3="v3">

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...