Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 14 of 14

Thread: <img> tag error

  1. #1
    New Coder
    Join Date
    Jul 2011
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Exclamation <img> tag error

    i am trying to place a image on my website but it won't let me could anyone tell me why it will not let me place the image where i want it?

    CODE:


    <html>
    <head>
    <title>My Webpage</title>
    </head>
    <body>
    <img src="../logo.gif" height="60" width="1400" /> <-- IMG TAG ERROR
    <fieldset>
    <table align="right">
    <tr>
    <td>
    <a href="LOGINPAGE.html" style="color:black;">Login</a>
    <a href="REGISTERPAGE.html" style="color:black;">Register</a>
    </td>
    </tr>
    </table>
    <h1 align="center">Hi and Welcome to HTMLHelp.com</h1>
    <table align="center">
    <tr>
    <td>
    <div style="color:yellow;">
    <a href="WEBPAGE(NOTLOGGEDIN).html" style="color:black;">Home</a>
    <a href="ABOUTTHISWEBSITE(NOTLOGGEDIN).html" style="color:black;">About This Website</a>
    <a href="FOURM(NOTLOGGEDIN).html" style="color:black;">Fourm</a>
    <a href="LEARNINGHTML(NOTLOGGEDIN).html" style="color:black;" >Learning HTML</a>
    </div>
    </td>
    </tr>
    </table>
    <table align="left">
    <tr>
    <td>
    <iframe src="C:\Users\Graham\Desktop\WebPage\SCROLLINGCONTENT1.html" width="1081" height="500" scrolling="yes">
    </iframe>
    </td>
    </tr>
    </table>
    <table align="right">
    <tr>
    <td>
    <iframe src="C:\Users\Graham\Desktop\WebPage\SCROLLINGCONTENT0.html" width="200" height="500" scrolling="yes">
    </iframe>
    </td>
    </tr>
    </table>
    </fieldset>
    <img="\IMGS\BHS.png" alt="txt" height="304" width="505">

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,640
    Thanks
    6
    Thanked 1,004 Times in 977 Posts
    Is the file path correct?

  • #3
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,335
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Shouldn't that be:

    <img src="myImageFolder/myImage.png">

    Also, you should really use a valid doctype to help ensure cross browser compliance.
    Teed

  • #4
    New Coder
    Join Date
    Jul 2011
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts
    I really want to do a valid doctype but i don't know how, and thank you it worked after i changed the picture type to png.

    P.S. could you send me a tutorial on how to make a valid doctype?

  • #5
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,640
    Thanks
    6
    Thanked 1,004 Times in 977 Posts

  • #6
    New Coder
    Join Date
    Jul 2011
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts
    thank you

  • #7
    New Coder
    Join Date
    Nov 2011
    Location
    Seattle, WA & Big Island, HI
    Posts
    13
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Was the error the incorrect filepath?

  • #8
    Regular Coder
    Join Date
    Aug 2005
    Location
    MS
    Posts
    831
    Thanks
    10
    Thanked 79 Times in 77 Posts
    If this is online, then your iframe paths will not work:

    Code:
    <iframe src="C:\Users\Graham\Desktop\WebPage\SCROLLINGCONTENT1.html" width="1081" height="500" scrolling="yes">
    </iframe>
    That refers to your hard drive on your own computer. The image error may be because you have an incorrect relationship between where the image is and the page using it. Plus, you may have forgot to upload the image. Do not close the image tag unless you are coding to XHTML. Even then you'll be flagged for no alt="" attribute and no character set tag.

    Why Validate?: http://validator.w3.org/docs/why.html
    CSS Validator: http://jigsaw.w3.org/css-validator/
    HTML Validator: http://validator.w3.org/#validate_by_uri+with_options
    ☠ ☠RON☠ ☠

  • #9
    New Coder
    Join Date
    Jul 2011
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Hi guys, its me again the image shows but it is all blurry because it is a lot smaller than how big I am trying to put it.Is there anyway I can fix this???

  • #10
    Regular Coder
    Join Date
    Aug 2011
    Location
    U.S.A.
    Posts
    233
    Thanks
    2
    Thanked 48 Times in 48 Posts
    get a higher resolution version of the image. There's not a way to resize an image Bigger without making it blurry.
    WordPress Designer and theme developer. KlongDesigns - helping bloggers and non-technical folks claim their space on the internet.

  • #11
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,628
    Thanks
    0
    Thanked 648 Times in 638 Posts
    You shouldn't need to specify the width and height on the HTML for an image unless you specifically want the alternate text to fill the same space if the image doesn't load. The image itself already knows how big it is.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #12
    Regular Coder
    Join Date
    Aug 2005
    Location
    MS
    Posts
    831
    Thanks
    10
    Thanked 79 Times in 77 Posts
    Most images made at 72 - 96 DPI are good enough for the web. You should ALWAYS specify the width and height of an image regardless of whether the image is to be shown original size or not. Always tell browsers exactly what you want them to do when parsing your web page.

    Enlarging low res images, as stated, is not a good idea unless it is a small increase in size which is under the level of distorting the image.
    ☠ ☠RON☠ ☠

  • #13
    New Coder
    Join Date
    Jul 2011
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question

    Question 1:How can I see what the current DPI of the image is?
    Question 2:How can I increase the DPI of the image?

  • #14
    Regular Coder
    Join Date
    Aug 2005
    Location
    MS
    Posts
    831
    Thanks
    10
    Thanked 79 Times in 77 Posts
    1) Just right click on the image file and select Properties. If viewing in a browser, it may say Image Info.

    2) You can increase the DPI, but it will not increase the resolution of a previously saved image at a lower DPI. You'll just increase the file size.

    Might help:

    Image Size and Resolution

    DPI - Changing/Setting DPI, dots per inch, pixels per inch
    ☠ ☠RON☠ ☠


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •