i wri开发者_C百科te 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>
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
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">
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:
- Determine the location of the page you are editing. This article is located in C:/xampp/htdocs/me/ folder on your site.
- 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/
- 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
Write the link using the rules listed above:
<img src="images/register.jpg" />
精彩评论