Need help with adding gaphics to an html

MartinC.

Baseband Member
Messages
56
I am trying to add a graphic to an html (using notepad) but when I test the website, my graphic shows up as a tiny x with the filename by it. Can someone help me please? thanks in advance :)
'edit' sorry for posting this in the wrong place...
 
sounds like you're not referencing the images properly - when you type the image name, you either need to type the relative path to it (relative to the HTML document you're writing) or the absolute name (so the absolute place on your hard drive or on the web that this image resides.)

If you're still stuck, post the relevant bit of HTML here - might help to work out where you're going wrong.
 
I think I'm putting the right path, heres the html

<HTML>
<HEAD>
<TITLE>Subscribe to Martin C. Design Forums</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
<CENTER>
<TABLE BORDER="0" CELLPADDING="2" ALIGN="Center">
<TR>
<TD BGCOLOR="blue"><P ALIGN=Center>
<FONT face="Verdana,Helvetica" SIZE="3" color="orange">
<B>Subscribe to Claim Your FREE Gift and more information on computer programing and graphics</B></FONT>
</TD>
</TR>
<TR>
<TD><B><FONT face="Verdana,Helvetica" SIZE="3" color="orange"><BR>
Subscribe to Martin C. Design Forums to recieve more information
on computer programing and graphics. <FONT color=
"blue">ALL new subscribers will receive 5 free icons.
</FONT></FONT></B><BR>
<img src="icons1/mclogo1-1.jpg" alt="mclogo1-1"><br>
<BR>
<FORM METHOD="POST" ACTION="YOURFORM.cgi">
<CENTER>
<TABLE BORDER="0" CELLPADDING="2" ALIGN="Center">
<TR VALIGN="Top">
<TD>
<INPUT type="text" name="email" value="type in your email"
size="20" onfocus="value=''">
<INPUT TYPE="submit" VALUE="Subscribe"></TD>
</TR>
</TABLE>
</CENTER>
</FORM>
<P ALIGN=Center>
<BR>
<A HREF="javascript: self.close()"><FONT face="Verdana,
Helvetica" SIZE="2">Close Window</FONT></A><BR>
</TD>
</TR>
</TABLE>
</CENTER>
</BODY>
</HTML>

P.S. there is no actaual Martin C. Design forums and also this is not completely made by me, it is a code that I copied of the internet and added some stuff to it and edited it.
 
Well, is there a folder called icons1 that's in the same directory as the above HTML file? And has that folder got a file in it called mclogo1-1.jpg? That's what "icons1/mclogo1-1.jpg" means.

Incidentally - I'm not sure how much you wrote yourself but that's an appalling example of modern HTML. You shouldn't use things like font tags, that should all be in CSS, tags should be lower case, tags should always be opened and closed properly (and when you've only got one like <br> use a self closing tag like <br/>), you should always have a namespace... If you're looking to learn HTML properly I'd look at the W3C tutorials, and validate everything you write with the W3C validation service to make sure you don't get any errors. Believe me that above code will generate quite a few...!

Oh and just a heads up, it's worth putting large blocks of code like the above in [ CODE ] tags so it appears like so:

Code:
System.out.println("Hello world");
 
Back
Top Bottom