Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

klink3r

macrumors newbie
Original poster
Mar 2, 2011
2
0
I'm doing a basic html project for a class in college and one of the requirements is to embed images into the document (we are not publishing them online or anything like that.)

I'm using textedit to do the html work.

The only problem I've had is, when using the <img src> command, the pictures (whether I use a file on my desktop or a url) will show up in my own browser(s), but when the site is loaded on a different computer, the pictures disappear.

Any suggestions? I'm not sure whether my professor will be just grading the HTML (because it would look right even if it isn't working) or the actual site, uploaded onto her own computer (where my pictures would undoubtedly not appear)...I'm preparing for the latter.
 
When you move the HTML file, are you also moving the pictures to the other computer?
 
When you move the HTML file, are you also moving the pictures to the other computer?

No, i figured that was the problem initially, so I started using the URL instead of the file on my computer.

Is the file being saved as plain text? Try Textwrangler instead. It's free.

i saved it as .txt, but then changed it to .html.

I've heard textwrangler is better...maybe i'll give it a shot and see what happens. thanks!
 
Last edited by a moderator:
First off you can do anything in textedit.

I've done css and javascript in it.

Secondly you need to make sure that your in a plain text file format (screenshot 1). Then all your docs need to be saved as .html or .css or .js .

In regards to your <img src>, you should make sure a your files are linked with the <a> element.

<img src="water.png or gif or jpeg"> (your code should look like this)

to link

do <a href="../images/image.png">pic</a>

Only use / for the root folders or use .. to let the server know how far up it has to go to get to the root folder. Screen shot 2 shows you that you can do things in variety of html and xhtml formats along with embedded or inline css. Just look in the system preferences of Text editor.

Text wrangler is no different then text edit....all text wrangler does is color your syntax but if your spacing and writing your code clean color syntax isn't needed.
 

Attachments

  • Untitled.png
    Untitled.png
    1.1 MB · Views: 93
  • Untitled 2.png
    Untitled 2.png
    1.1 MB · Views: 84
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.