Jump to content

new to html & need help


cajungatorgirl

Recommended Posts

When you first start your html first page do you have to put it on your website for every thing ot work right. I tried to add a image from a folder on my pc. but it will not show up in the page I am working with. I am useing notepade to edit with.

Link to comment
Share on other sites

Well, it's best if you have some testing server to test the things on, but it's optional. To use an absolute path for a file from your computer, you should use something like this:

<img src="file:///D|/folder/.../file.jpg" />

For example, if your picture is located in "D:\MySite\Pictures\logo.jpg", then the adress you must use in the <img> would be:

<img src="file:///D|/MySite/Pictures/logo.jpg" />

But this way, the image would be visible only from your computer. If you want to save yourself time to write URLs instead, simply create an images folder in the folder where the HTML file is located and add the images there. For example, if your HTML file called index.html is located at "D:\MySite" (the full file path is "D:\MySite\index.html") then create a folder and add all the images there. If the name of that new folder is "Pictures", and our image called logo.jpg is there, then you can use this in index.html to reference the picture:

<img src="Pictures/logo.jpg" />

Link to comment
Share on other sites

But this way, the image would be visible only from your computer. If you want to save yourself time to write URLs instead, simply create an images folder in the folder where the HTML file is located and add the images there. For example, if your HTML file called index.html is located at "D:\MySite" (the full file path is "D:\MySite\index.html") then create a folder and add all the images there. If the name of that new folder is "Pictures", and our image called logo.jpg is there, then you can use this in index.html to reference the picture:
<img src="Pictures/logo.jpg" />

That is called a "relative path", instead of an absolute path. If you are creating web pages on your home computer, you will want to use relative paths, so that you don't have to re-write the image URLs when you put your page online. Relative paths specify where the image is relative to your HTML page. Here's some more about relative paths:http://w3schools.invisionzone.com/index.ph...opic=5325&st=20
Link to comment
Share on other sites

hey does this work for my site to ? not just on my pc woth notepad but on a online site?

yes, the situation justsomeguy describes is the case for any machine or set up. one way I typically describe is like this. think of your website as your house and the pages on your site are like each room of the house. Now lets say I want to get to the kitchen. You could say goto 1234 My Street and goto the kitchen. For your site, that might translate to http://www.mystreet.com/kitchen.htm - that is an example of an absolute path - you stating how to get ther without any question, you absolutely must go to 1234 My Street to get to my kitchen.Now lets say, from the kitchen, you want to go to the living room. You have two options in the world of the internet. You can go the long way or the short way - I won't go into the benefits or drawbacks of each right now. The long was would be to tell your friend to first go to 1234 My Street and goto the kitchen, then goto 1234 My Street and goto the living room. That would be, in internetesse, http://www.mystreet.com/kitchen.htm then http://www.mystreet.com/livingroom.htm. But, if you chose to go the short way, then you do not have to state the whole street address if you are already there. So you could simply say, goto 1234 My Street and goto the kitchen, then goto the living room. That would translate to http://www.mystreet.com/kitchen.htm then livingroom.htm. This is known as the relative path and you can remember it two ways. Since a relative lives in teh same house as you, then you know you can use the short method - you're in the same house. Or, and more appopriately, the file is located in the same folder or location relative to where you are right now. That is to say that if you are already at 1234 My Street and in the kitchen, then the living room is already relative to your location.Now this is why this is relevent to the question at hand. No matter what file you want to reference on the internet and no matter where it is, be it an image, another web page, or a pdf file, you can only do it through an absolute or relative path. Therefore, you have to make sure all your references <a> or <img> begin with a file name/location or the web address of the file.Hope that helps in addition to the other information offered.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...