Jump to content

Slight Issue With Adding Image


Beg

Recommended Posts

Hello can someone please tell me what im doing wronghave read instruction on adding images to html seems i must be missing somthing or doing it wrongplease helpOk i have saved the image to the same file as the html im trying to developits a jpg imageim trying to place it at the top centre of the page cant seem to get the image though tryed copy and paste this<img src="images/logo.png" />then changed it to read <img src="images/newbie banner.jpg" /> Im using notepadthis is a copy of what I have done . I know not much but got to start some where<html> <head><img src="images/newbie banner.jpg" /><title>This is My first site.</title> </head> <body style="background-color:#F5DEB3"> <p> this is my first website build so may have all sorts of stuff in it.<p>like Ivy is looking at dining tables and chairs on trademe<br/><p>At the momentwhich happens to be a Auction site very similar to ebay<p> which is a Auction site also<em><strong>both are online auction sites.these are the links</strong></em><br/> </body> </html>So ok What am i Doing Wrong???

Link to comment
Share on other sites

The img tag (and all content) has to go inside the body element.Also, spaces need to be encoded as %20. Try not to use spaces in filenames. Check that the image actually exists were you think it does.On a separate note, <p> is not an empty tag and the end of each paragraph needs to be denoted by </p>.

Link to comment
Share on other sites

The img tag (and all content) has to go inside the body element.Also, spaces need to be encoded as %20. Try not to use spaces in filenames. Check that the image actually exists were you think it does.On a separate note, <p> is not an empty tag and the end of each paragraph needs to be denoted by </p>.
In fact, in HTML 4.01 Strict, it is perfectly valid to leave a <p> tag open. Try in the W3C validator. (Also, refer to my signature)
Link to comment
Share on other sites

Which admittedly is not the same thing as saying it's not valid.
That's not mentioning open tags, it's mentioning empty elements, like this: <p></p>. It really is a bad practice.Not closing <p> tags is neither a bad practise, nor discouraged. It's just more normal and easier to understand writing a closing </p> tag in HTML (that's why I do it). Also, it makes it easier to switch to XHTML if that becomes necessary.
Link to comment
Share on other sites

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html>	<head>		<title>Test</title>	<body>		<p>			Test

Alright, this is valid, but do you really recommend anyone code like this?Edit: But ok, it isn't technically incorrect.

Link to comment
Share on other sites

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html>	<head>		<title>Test</title>	<body>		<p>			Test

Alright, this is valid, but do you really recommend anyone code like this?Edit: But ok, it isn't technically incorrect.

When it comes to <p> and <li> tags in HTML 4.01, I don't recommend it, but neither do I discourage it.It all depends on the preference of the web programmer because it has no negative effect whatsoever on the resulting page.Other practices, such as short-tags (example:
<a href=""<b></</a>

), I discourage because it has little support from many browsers (I think the big ones work, though).

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...