Help - Search - Members - Calendar
Full Version: Adding A Picture
BleepingComputer.com > Internet & Networking > Web Site Development
   
skeeter395
I have started to make a web page with html tags and notepad. I want to know if I can add a picture that i have saved on my harddrive and if I can vew the picture on the page befor I publish it? Thanks for any help.
TVT
Youre going to have to put the picture on the server with your website. And you wont link to the picture on your hard drive but the one on the server. For example if you have www.mysite.com and you want bob.jpg to be displayed on your page. You would have to upload the picture to the website, possibly www.mysite.com/images/bob.jpg. Then in the html document you would use the <img src="http://www.mysite.com/images/bob.jpg width="x" height="y">. Hopefully that made some sense.

Looking back, I think I misunderstood what you were asking. Use the <img src="file:///filepath width="x" height="y"> to insert any picture on your hard drive while designing. Just make sure you change it to the online image when you get to actually hosting the website.
medab1
QUOTE(skeeter395 @ Nov 30 2007, 11:11 PM) *
I have started to make a web page with html tags and notepad. I want to know if I can add a picture that i have saved on my harddrive and if I can vew the picture on the page befor I publish it? Thanks for any help.


Hello,

What I have gotten into the habit of doing is to create the html file with notepad with all the needed image files or whatever located in a FOLDER in My Documents.

All pictures or whatever is going to be called up by the html file is included in the same folder or directory.
Folder on computer,directory on website.

When satisfied with the results,I open the webshell at Angelfire,where I have my site, & I upload the entire folder to a directory of its own.
Using the file name with notepad in the html file with the picture or whatever is ok.
It works if the entire folder is uploaded to a directory on you website server.

As you may know,an html file needs all added things like pictures,etc., added to the same directory as the html file itself.

It saves you from having to use the entire WEBSITE url of added images & things.
For example-
<img src="dog.jpg"> instead of <img src="god_knows_how_long_a _ server_url_will_be_/dog.jpg>

If you have mydog.html & a picture called rex.jpg is included in the folder uploaded or directory on your server the picture will work.

I hope that makes sense. blink.gif

Edit--

I'm so used to doing things like this that sometimes it is hard to explain things that are simple to me to someone else.
I am always available for extended help if what I write here is questionable.
Noot
To view this, all you have to do is go to your browser, click File>Open File>then find your .html file

You will be able to view it as if it was up and live.

You can use either an absolute path or a relative path for linking your imagery. An absolute path, would be as TVT mentioned. Locating from your C drive and through each folder until you get to the exact file. A relative path is usually starting from the point where your index.html file is located. For example, if you have a folder on your desktop called "Site" and within that folder you have your index.html folder and a folder called 'images'. Within that folder would be an image called, 'happy.jpg' To write it, because your site is contained within your 'Site' folder, all you have to write in your index.html is: <img src="images/happy.jpg">

If you use the absolute path, you will have to do as TVT mentioned and change the path name to the online file name once it's online. The relative, you shouldn't have to change anything.

ps: You can do this also with links, using the <a href="link.html">Link</a> code as well.


Good luck and I hope my 2¢ helped! smile.gif
skeeter395
thanks for the replys.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.