Results 1 to 7 of 7

Thread: What is the error in this line of code

  1. #1
    Fanatic Member
    Join Date
    Nov 10
    Posts
    772

    What is the error in this line of code

    Hi, i am newbie to html, i am stuck with a line of code, please assist me that what is wrong with this code.

    <img src = "LRH.jpeg" alt = "job in lady reading" width = "300" length = "400"/>

  2. #2
    Frenzied Member
    Join Date
    Apr 09
    Location
    CA, USA
    Posts
    1,500

    Re: What is the error in this line of code

    No such attribute as "length."

  3. #3

  4. #4
    Frenzied Member
    Join Date
    Apr 09
    Location
    CA, USA
    Posts
    1,500

    Re: What is the error in this line of code

    Then check that the file name of your image is correct and that it's in the proper location (in the same directory as your HTML page, for how you've written it here).

  5. #5
    Fanatic Member
    Join Date
    Nov 10
    Posts
    772

    Re: What is the error in this line of code

    Quote Originally Posted by SambaNeko View Post
    Then check that the file name of your image is correct and that it's in the proper location (in the same directory as your HTML page, for how you've written it here).
    Yes, its in the same directory, i have place the picture and html page in a folder on desktop but its showing picture.

    secondly lets suppose if i place the file somewhere else then how would i address the location in coding? Will I write the complete path of the picture?

  6. #6
    Frenzied Member
    Join Date
    Apr 09
    Location
    CA, USA
    Posts
    1,500

    Re: What is the error in this line of code

    You can either write the path to the image beginning at the web root (this is known as an "absolute" path), or you can write it in relation to the directory where the HTML file is (a "relative" path).

    Absolute paths begin with a / (or with the full domain name) and must include every directory between the root and the image, eg. "/subfolder/images/myImage.jpg"

    Relative paths begin with either the name of a directory that resides in the same location as the HTML file, or with a ".." to signify the parent directory of the HTML file, eg. "images/myImage.jpg" or "../othersubfolder/images/myImage.jpg"

  7. #7
    Fanatic Member
    Join Date
    Nov 10
    Posts
    772

    Re: What is the error in this line of code

    Quote Originally Posted by SambaNeko View Post
    You can either write the path to the image beginning at the web root (this is known as an "absolute" path), or you can write it in relation to the directory where the HTML file is (a "relative" path).

    Absolute paths begin with a / (or with the full domain name) and must include every directory between the root and the image, eg. "/subfolder/images/myImage.jpg"

    Relative paths begin with either the name of a directory that resides in the same location as the HTML file, or with a ".." to signify the parent directory of the HTML file, eg. "images/myImage.jpg" or "../othersubfolder/images/myImage.jpg"

    Now Samba i have change the code like this.

    <img src = "ss.jpeg">

    the picture which is on my desktop, along with the web page on desktop too, is named as ss.jpeg. But it's still not displaying picture. so how do i do this now? Please guide me.

Posting Permissions

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