How do I add image to my web page?

  • Thread starter Thread starter Math10
  • Start date Start date
  • Tags Tags
    Image Web
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 1K views
Math10
Messages
301
Reaction score
0

Homework Statement


How do I add image to my web page?

Homework Equations


None.

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 " "?
 
Physics news on Phys.org
Math10 said:

Homework Statement


How do I add image to my web page?

Homework Equations


None.

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 " "?
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.
 
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.