Html Help

Discussion in 'HTML & Website Design' started by diam26, Sep 6, 2008.

  1. #1
    Hi,
    I am learning html at w3school. I am trying to work how to put the image in the page but the Image in not displaying. I save the html file in my homepage folder and also image in the same folder. but when I try to open the web page image is not displaying so please help what mistake I am making. Here is the code I am using.
     
    diam26, Sep 6, 2008 IP
  2. bigpapa

    bigpapa Banned

    Messages:
    273
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Make sure your images are stored in the same folder as your html page, or try inserting the exact location of the image, i.e.:

    <img src="http://yourdomain.com/hackanm.gif"
    width="48" height="48">

    Also, you don't specifically need to include the width and height for the image to display.
     
    bigpapa, Sep 6, 2008 IP
  3. diam26

    diam26 Peon

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The image is saved in the same folder but still cant display?


     
    diam26, Sep 6, 2008 IP
  4. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #4
    True. But it is good practice to do so. This is for allowing the browser to allot space for those dimensions before downloading the actual image. Otherwise, you get the pages that loads tons of images and while you are reading content the page starts "jumping" all over the place. Very irritating.

    Is the filename and extension correct? It probably is, but had to ask.

    If you would post the Url of the page in question, that would help.
     
    Dodger, Sep 7, 2008 IP
  5. -Hammad-

    -Hammad- Peon

    Messages:
    37
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Why are you inserting the 'width' and 'height' attributes and values on separate lines?
     
    -Hammad-, Sep 7, 2008 IP
  6. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #6
    It came from a tutorial. Plus it does not matter. Some utilities like Html Tidy will format your code that way too. Try not to confuse the person with some of the trivial stuff.
     
    Dodger, Sep 7, 2008 IP
  7. diam26

    diam26 Peon

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    You are right this code is from w3school tutorial. I don't know why the image is not working.I saved the image in the same folder where I saved the page. and I created the page on Notepad. Can some one try this code and let me know whats problem while I think everything is according to the rule. Since I am new learner so I am very nervous facing this problem, please help me.


     
    diam26, Sep 7, 2008 IP
  8. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Try adding the the slash at the end:

    <img src="constr4.gif"
    width="144" height="50" [COLOR="Red"]/[/COLOR]>
    Code (markup):
     
    Dodger, Sep 7, 2008 IP
  9. bigpapa

    bigpapa Banned

    Messages:
    273
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I just thought of something very basic you may have made a mistake with:

    You said that you typed the code in wordpad. Did you save it and upload it as an HTML file?
     
    bigpapa, Sep 7, 2008 IP
  10. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Actually, it was Notepad (not wordpad). But that got me to thinking about something else.

    Is this page on a Web Server at all? If you are trying to view this from your own machine, it is NOT going to work. If it is on a web server, a Url to the page would be nice.
     
    Dodger, Sep 7, 2008 IP
  11. jagan123

    jagan123 Active Member

    Messages:
    775
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    85
    #11
    I'm sure.. the person might not have uploaded the file to the server.
    He must have placed the notepad file, html file, two images in the same folder and was trying out the result, it seems.
    And there could be no problem with the script.
     
    jagan123, Sep 7, 2008 IP
  12. diam26

    diam26 Peon

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    You are right, I am trying to open in my pc, not hosted in server. I saved the file as Html and didn't save the image twice. I agree, may be it may not work on my pc but it can work on server. I will try to upload it online then it may work.
    Thanks you so much to all of you guys.


     
    diam26, Sep 7, 2008 IP
  13. diam26

    diam26 Peon

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Dear Friend,
    Html pages designed by Notepad can be displayed online only? I mean the with the graphics?

    How we can preview offline the Html page designed by Notepad specially the with the graphics?


     
    diam26, Sep 8, 2008 IP
  14. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #14
    The term is "view web pages locally". In order to do that, you need to install a web server on your computer.

    There are installation packages that will install Apache Web Server, PHP, MySQL and Perl on your local machine. Try XAMPP from Apache Friends.

    Once installed, there is a directory labelled /htdocs/ . . . this is where you will save all of your html files. Browsing to http://localhost in your web browser will pull up the 'index' file in that root directory.
     
    Dodger, Sep 8, 2008 IP
  15. diam26

    diam26 Peon

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Thanks so much.
    So complicated.So we cant see the preview when we are designing the Html pages with graphics like Frontpage. If we use Dreamweaver or any other free program can we able to view the page? I heared that in the Dreamweaver we can design the Html webpage?


     
    diam26, Sep 9, 2008 IP
  16. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Most Commercial (FrontPage, Dreamweaver) and Freeware(Html-kit) editors have built-in Html previewers, no web server needed. In order to view scripted pages, such as .php and perl, you will need the web server and the interpreters installed on your machine for local files. Otherwise, you will need to FTP/Publish those pages onto a remote web server.
     
    Dodger, Sep 9, 2008 IP
  17. phsxdl

    phsxdl Guest

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #17
    I can't find any problem with the script.
     
    phsxdl, Sep 9, 2008 IP
  18. diam26

    diam26 Peon

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #18
    I want to preview the page on my desktop that is the problem.

     
    diam26, Sep 10, 2008 IP
  19. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #19
    Try editing your Html with Html-kit. It has a preview tab to look at your work with. It is the only editor that I will endorse. I have been using it for over 5 years and it has everything you will need (including built-in third party TopStyle Lite support)

    From their website:

    As mentioned earlier. The preview works for standard Html pages. If you get into scripting with PHP you will need XAMPP (or equivalent) installed on your local machine.
     
    Dodger, Sep 10, 2008 IP
  20. TopherX

    TopherX Banned

    Messages:
    58
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #20
    If you are in a content management system you have to be sure to use the full url of the graphic because it isn't always clear how your server with interpret your site's structure. I don't know TypePad, but I had this same problem when I started using wordpress.

    Also test the image url in a browser window, if the image doesn't come up the problem is with your path not your code.
     
    TopherX, Sep 10, 2008 IP