10 Replies - 786 Views - Last Post: 30 January 2011 - 11:42 PM

#1 Guest_AnotherNoob*


Reputation:

I need help with some html code.

Posted 29 January 2011 - 07:16 PM

I recently started a Web Technology class and I was asked to make a website from scratch just by looking at this image: http://imm.sheridanc...sson03/hint.gif

So far I have been able to get most of it working, but I am having 3 problems:

1. I can't find the right colors for the website, I have looked everywhere and I can't get all the colors I need.(Only one of them matches)

2. At the bottom where it says "Privacy/Contact" I cannot type "Privacy Policy" instead of "Privacy" alone, because the table gets messed up and it doesn't look good. (You guys could try it with my current code to see what I am talking about)

3. In order to make my hyperlinks work (ex.News,Events,etc...) I made 5 other copies of my current HTML and I changed the text in the main table, but I am not sure if my teacher will be able to see it when I send it to him, since I used an absolute path (if I am not mistaking).

Here is my code so far:

<html>
 <head>
  <title> This is a test </title>
	</head>
		 <body bgcolor="#333399" >
			<br>
			<br>
			 <TABLE WIDTH=70% BORDER=1 CELLPADDING=30 CELLSPACING=2 align= center style="background-color: #003366;" >
				<TR>
					<TD>
						<img style="border:2px SOLID  #545565;" src="http://imm.sheridanc.on.ca/webtech/lesson03/logo.gif" width="150" height="60" ALIGN=LEFT />
						<img style="border:4px SOLID  #545565;" src="http://imm.sheridanc.on.ca/webtech/lesson03/ad.gif" width="670" height="60" ALIGN=RIGHT />
								<br>
								<br>
								<br>
								<br>

			<TABLE WIDTH=18% BORDER=1 CELLPADDING=2 CELLSPACING=2 align= left style="background-color: #3399CC;">
				<TR>
					<TD>
					<P><A style="color: #99CCFF" HREF=file:///C:/Users/Mald/Documents/Web%20Technologies/HTML%20Practice1.html.html/>News</A></P>
					<P><A style="color: #99CCFF" HREF=file:///C:/Users/Mald/Documents/Web%20Technologies/HTML%20Practice2.html.html/>Events</A></P>
					<P><A style="color: #99CCFF" HREF=file:///C:/Users/Mald/Documents/Web%20Technologies/HTML%20Practice3.html.html/>Personals</A></P>
					<P><A style="color: #99CCFF" HREF=file:///C:/Users/Mald/Documents/Web%20Technologies/HTML%20Practice4.html.html/>Movies</A><P> 
					</TD>
				</TR>
			</TABLE> 
			<TABLE WIDTH=78% BORDER=1 CELLPADDING=2 CELLSPACING=2 align= right>
				<TR>
					<TD>
					<P> lblaladlasldadq weqweqweadaqw qdqd qdqd qdqdqda qwdasdwqaasdwaaaaaaaaaaaaaaaaaaasdwadsdwad
						aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
						lblaladlasldadq weqweqweadaqw qdqd qdqd qdqdqda qwdasdwqaasdwaaaaaaaaaaaaaaaaaaasdwadsdwad
						lblaladlasldadq weqweqweadaqw qdqd qdqd qdqdqda qwdasdwqaasdwaaaaaaaaaaaaaaaaaaasdwadsdwad
						lblaladlasldadq weqweqweadaqw qdqd qdqd qdqdqda qwdasdwqaasdwaaaaaaaaaaaaaaaaaaasdwadsdwad
						lblaladlasldadq weqweqweadaqw qdqd qdqd qdqdqda qwdasdwqaasdwaaaaaaaaaaaaaaaaaaasdwadsdwad
						lblaladlasldadq weqweqweadaqw qdqd qdqd qdqdqda qwdasdwqaasdwaaaaaaaaaaaaaaaaaaasdwadsdwad
						lblaladlasldadq weqweqweadaqw qdqd qdqd qdqdqda qwdasdwqaasdwaaaaaaaaaaaaaaaaaaasdwadsdwad
						lblaladlasldadq weqweqweadaqw qdqd qdqd qdqdqda qwdasdwqaasdwaaaaaaaaaaaaaaaaaaasdwadsdwad
						lblaladlasldadq weqweqweadaqw qdqd qdqd qdqdqda qwdasdwqaasdwaaaaaaaaaaaaaaaaaaasdwadsdwad
						lblaladlasldadq weqweqweadaqw qdqd qdqd qdqdqda qwdasdwqaasdwaaaaaaaaaaaaaaaaaaasdwadsdwad
						lblaladlasldadq weqweqweadaqw qdqd qdqd qdqdqda qwdasdwqaasdwaaaaaaaaaaaaaaaaaaasdwadsdwad
						lblaladlasldadq weqweqweadaqw qdqd qdqd qdqdqda qwdasdwqaasdwaaaaaaaaaaaaaaaaaaasdwadsdwad
					</P>
					</TD>
				</TR>
			</TABLE> 
								<br>
								<br>
								<br>
								<br>
								<br>
								<br>
								<br>
								<br>
								<br>
								<br>
			<TABLE WIDTH=18% BORDER=1 CELLPADDING=2 CELLSPACING=2 align= left style="background-color: #3399CC;">
				<TR>
					<TD>
					<P><A style="color: #99CCFF" HREF=file:///C:/Users/Mald/Documents/Web%20Technologies/HTML%20Practice5.html.html/> Secondary</A></P>
					<P><A style="color: #99CCFF" HREF=file:///C:/Users/Mald/Documents/Web%20Technologies/HTML%20Practice6.html.html/> Menu</A></P>
					</TD>
				</TR>
			</TABLE> 
								<br>
								<br>
								<br>
								<br>
								<br>
								<br>					
			<TABLE WIDTH=100% BORDER=1 CELLPADDING=2 CELLSPACING=2 align= center style="background-color: #3399CC;">
				<TR>
					<TD align="right"valign="center" ><FONT SIZE=4><A style="color: #99CCFF" HREF=http://www.sheridanc.on.ca/Admissions/Apply/Continuing%20Education/General%20Information/Administrative%20Information/Protection%20of%20Personal%20Privacy.aspx/>Privacy</A></FONT></TD>
					<TD align="left" valign="center" ><FONT SIZE=4><A style="color: #99CCFF" HREF=http://www.sheridaninstitute.ca/about%20sheridan/contact%20%20us.aspx/>Contact</A></FONT></TD>
				</TR>
			</TABLE> 
					</TD>
				</TR>
			</TABLE> 
		 </body>
</html>



Is This A Good Question/Topic? 0

Replies To: I need help with some html code.

#2 Gorian  Icon User is offline

  • ninja DIC
  • member icon

Reputation: 120
  • View blog
  • Posts: 1,681
  • Joined: 28-June 08

Re: I need help with some html code.

Posted 29 January 2011 - 08:34 PM

Well, upon looking at that, my first critique would be to ditch the tables and structure your layout with divs and CSS.

see here, here, and here

This post has been edited by Gorian: 29 January 2011 - 08:35 PM

Was This Post Helpful? 0
  • +
  • -

#3 Glorfindal  Icon User is offline

  • Java Enthusiast
  • member icon

Reputation: 23
  • View blog
  • Posts: 538
  • Joined: 31-December 08

Re: I need help with some html code.

Posted 29 January 2011 - 09:22 PM

Also don't use capital letters in your tags it is a bad habit and will cause problems in more advanced Programming
Was This Post Helpful? 0
  • +
  • -

#4 ClearRift  Icon User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 37
  • Joined: 09-December 10

Re: I need help with some html code.

Posted 29 January 2011 - 11:36 PM

I would follow the directions provided above to start using a div based layout with css. You will be very happy you did.

With the links....

You will need to use relative hyperlinks if you want them to work for anyone not using your computer. The links in your code point to a place in your file system that does not exist in theirs. Here is an example.

Lets say i have the following directory(folder) structure for my site

Root
--privacy
-privacy.html

--funpages
-fun1.html

-fun2.html


If i am on the fun2.html page and I want to provide a link to fun1.html i would use
fun1.html

However, If i am on the fun2.html page and I want to provide a link to privacy.html i would use
../privacy/privacy.html


The ../ tells us that we need to climb out of the directory that we are in. Then, the rest of the code says to go into the privacy directory and find the privacy.html file.

Using relative paths can be confusing at first. Just look at the last parts of your absolute links though and you will see the relevant parts you need. The rest of the junk c:/users/ blah blah blah will all be assumed by your professor's computer but with his file systems information.

I hope this helps......learn CSS! Ditch the tables:)
Was This Post Helpful? 0
  • +
  • -

#5 drhowarddrfine  Icon User is offline

  • D.I.C Regular

Reputation: 39
  • View blog
  • Posts: 275
  • Joined: 28-July 10

Re: I need help with some html code.

Posted 30 January 2011 - 06:33 AM

And you are missing a doctype.

You should probably drop this class as it looks like you are being taught antique coding methods.

This post has been edited by drhowarddrfine: 30 January 2011 - 06:35 AM

Was This Post Helpful? 0
  • +
  • -

#6 Guest_AnotherNoob*


Reputation:

Re: I need help with some html code.

Posted 30 January 2011 - 08:51 AM

View Postdrhowarddrfine, on 30 January 2011 - 06:33 AM, said:

And you are missing a doctype.

You should probably drop this class as it looks like you are being taught antique coding methods.


Guys chill out, I have been in school for only 3 weeks, and I have this class only once a week. So far the teacher has only been over the basic stuff and he tells us to read tutorials, I do the best I can with the info I get out of them. Also he was gonna teach us CSS next week and I can't drop his class, because I am in College and this is one of the classes that it's a must for my program. Anyways I will now look at the links provided.
Was This Post Helpful? 1

#7 ClearRift  Icon User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 37
  • Joined: 09-December 10

Re: I need help with some html code.

Posted 30 January 2011 - 11:02 AM

Def do not drop the class. Although tables are disliked by many, the fact of the matter is that they do exist and it's important to know how they work. We could make recommendations about stuff in your code all day but I think you've done an okay job for your first assignment.

Let me address your questions in order:

Quote

1. I can't find the right colors for the website, I have looked everywhere and I can't get all the colors I need.(Only one of them matches)

try this color picker:
W3 Schools Color Picker

Quote

2. At the bottom where it says "Privacy/Contact" I cannot type "Privacy Policy" instead of "Privacy" alone, because the table gets messed up and it doesn't look good. (You guys could try it with my current code to see what I am talking about)


Because this table is nested into the other table it's inheriting some of the attributes set in the parent table (width="70%"). Try setting the width of the "privacy policy" <td> to 50%.
<TD align="right" valign="center" width="50%" >


Also, you are experiencing a lot of the spacing trouble because of the cellpadding attribute declaration in the first table. Set this to 0 and everything will be lined up nicely. This attribute is telling each cell to have 30px of padding. From the template you posted it looks like you are trying to achieve 10px of padding around the outside of the whole table. So, instead of using cellpadding, add padding: 10px; to your style attribute like this:
<TABLE WIDTH="70%" BORDER="1" CELLPADDING="0" CELLSPACING="2" align= center style="background-color: #003366; padding: 10px;" >



Quote

3. In order to make my hyperlinks work (ex.News,Events,etc...) I made 5 other copies of my current HTML and I changed the text in the main table, but I am not sure if my teacher will be able to see it when I send it to him, since I used an absolute path (if I am not mistaking).


Please see my previous reply. let me know if you have any questions.
Was This Post Helpful? 0
  • +
  • -

#8 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,225
  • Joined: 08-June 10

Re: I need help with some html code.

Posted 30 January 2011 - 03:33 PM

View PostGlorfindal, on 30 January 2011 - 05:22 AM, said:

Also don't use capital letters in your tags it is a bad habit and will cause problems in more advanced Programming

capital letters for the tag names are actually the default for HTML.
Was This Post Helpful? 0
  • +
  • -

#9 Glorfindal  Icon User is offline

  • Java Enthusiast
  • member icon

Reputation: 23
  • View blog
  • Posts: 538
  • Joined: 31-December 08

Re: I need help with some html code.

Posted 30 January 2011 - 04:02 PM

@Dormilich What do you mean default? Because all the websites that I used to learn HTML and all the tutorials never had capital letters in any of the source code. Where did you learn HTML? I learned it at W3Schools.com.

@Guest_AnotherNoob Run through all your code I see many spots where you don't have quotation marks. (Example align= center should be align="center")
Was This Post Helpful? 0
  • +
  • -

#10 drhowarddrfine  Icon User is offline

  • D.I.C Regular

Reputation: 39
  • View blog
  • Posts: 275
  • Joined: 28-July 10

Re: I need help with some html code.

Posted 30 January 2011 - 04:33 PM

View PostGlorfindal, on 30 January 2011 - 05:02 PM, said:

@Dormilich What do you mean default? Because all the websites that I used to learn HTML and all the tutorials never had capital letters in any of the source code. Where did you learn HTML? I learned it at W3Schools.com.
I'm sure Dorm learned it by reading the W3C spec, as I have, and if you were to read it, you'd learn he is correct. "Default" might be the wrong word but the specification definitely shows the tags in uppercase.

While I won't knock W3Schools too much, it's not the prime place for learning and, just in case, W3Schools is in no way affiliated with the W3C.

This post has been edited by drhowarddrfine: 30 January 2011 - 04:42 PM

Was This Post Helpful? 0
  • +
  • -

#11 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,225
  • Joined: 08-June 10

Re: I need help with some html code.

Posted 30 January 2011 - 11:42 PM

additionally, if you alert the tagName property of any element, it will always show up in uppercase (in contrast to XHTML, where it will show up in lowercase).
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1