how the F do i add photos in html? just started learning?

3 Answers

Relevance
  • keerok
    Lv 7
    5 days ago

    You effing study!!!

    • Login to reply the answers
  • 6 days ago

    This is based on information in your comments to Robert J's answer.  (That should have been in details for your question at the beginning, by the way.)

    The X almost certainly means that the browser couldn't find the image.  (Different browsers behave differently.  Firefox creates an image that simply contains the alt= text, for example.)

    So, make sure the file name in src= is exactly correct (including correct upper/lower case if the web page will ever be stored on a system not running Windows), and that the image is in the same directory as your html file.

    Those are the usual problems...wrong name or wrong location.  Everything needed for a website should be in one directory, possibly with subdirectories for organizing things like images, scripts, etc.  If you put you png file in subdirectory named "images", the reference should be src='images/muzzle flash.png'.  Always use the / forward slash for web references--even on Windows where the usual path separator is a \ backslash. 

    • Login to reply the answers
  • 6 days ago

    Use the <img></img> tag.

    The photos need to be in a directory on the web server, often just "images" in the site root folder.

    Example:

    <img src="images/somephoto.jpg" alt="Photo Description" width="240" height="200">

    The photo can be .png, .jpg, .gif 

    The alt text is what shows with a mouse hover over the image.

    Height and width parts re optional, without those the image is shown at actual pixel size.

    If that is much bigger than you want to show it as, it's best to resize it before uploading rather than override the size - the page will load faster if no resize is needed, as that's done in the web browser and the actual image file is sent full size.

    The whole img tag can be embedded in an <a> anchor, along with any other text, if you want it as a clickable link.

Still have questions? Get your answers by asking now.