1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: How do I add image to my web page?

  1. Oct 19, 2014 #1
    1. The problem statement, all variables and given/known data
    How do I add image to my web page?

    2. Relevant equations

    3. The attempt at a solution
    I know that the img element is <img src="logo.png" alt="My Logo"> but I don't know what to type between the 2 quotation marks for "logo.png" and "My Logo". I put logo.png and My Logo between them but it doesn't work. What should I input between " " and " "?
  2. jcsd
  3. Oct 19, 2014 #2


    Staff: Mentor

    If logo.png is in the same directory as the HTML page that contains this img element, what you have should work. If the file is in some other directory, you need to supply the path and file name.

    The alt attribute is alternate text to display in case the viewer's browser is unable to download the image. You can put in there pretty much whatever you want.
  4. Oct 19, 2014 #3


    User Avatar
    Gold Member

    As Mark44 said, but let me elaborate.

    Is your picture online right now? Are you able to see it somewhere? If so, how? You must have a URL that points to it. (the address in your address bar of your browser).

    The URL is what you put in the src="". There are subtleties, but that's the gist of it.

    Don't worry about alt too much just yet. It is not essential to displaying your image.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted