Mahdi_Nine
Mahdi_Nine

Reputation: 14751

problem with img in html

i write this code in a html page but it doesn't show the image what is problem?

<html>
<head>
<title>register page</title>
<body>
</head>
<table align="center">
<tr>
<td>
<img src="C:/xampp/htdocs/me/images/register.jpg" width="600" height="395">
</td>
</tr>


</table>
</body>
</html>

Upvotes: 0

Views: 3418

Answers (3)

bungdito
bungdito

Reputation: 3620

did you check if is it the image available on that folder?

it would be nice if you are using relative path:

Relative Path URLs

Relative paths change depending upon what page the links are located on. There are several rules to creating a link using the relative path:

links in the same directory as the page have no path information listed filename sub-directories are listed without any preceding slashes weekly/filename links up one directory are listed as ../filename

How to determine the relative path:

  1. Determine the location of the page you are editing. This article is located in C:/xampp/htdocs/me/ folder on your site.
  2. Determine the location of the page or image you want to link to. The Beginner's Resource Center is located here: C:/xampp/htdocs/me/images/
  3. Compare the locations and to decide how to point to it From this article, I would need to step up one directory (to/library) and then go back down to the beginning directory
  4. Write the link using the rules listed above:

    <img src="images/register.jpg" />

Upvotes: -1

Demian Brecht
Demian Brecht

Reputation: 21368

If you're running it served from the actual server, the image src is invalid. It needs to be relative to your application root. In other words, if you application root is C:/xampp/htdocs/me, then your image tag should actually be <img src="/images/register.jpg" width="600" height="395">

Upvotes: 5

Abe Miessler
Abe Miessler

Reputation: 85046

You have provided a full file path, not a relative path or URL.

If your website lives in htdocs, try changing the path to /me/images/register.jpg

Upvotes: 5

Related Questions