Location url for displaying images in CSS code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AnagJohari
    New Member
    • May 2010
    • 96

    #1

    Location url for displaying images in CSS code

    For the location of an image in my CSS code, when I use (../img/h_img.jpg), double dots, the image will not display in the browser. But when I use url(./img/h_img.jpg), single dot, the image is visible.

    Why does the image not display by the first code(double dots)?

    Code:
    .header_img {
    width:895px;
    height:255px;
    background:url(../img/h_img.jpg)}
    Last edited by Niheel; May 7 '10, 07:54 AM. Reason: Code tags, grammar, spelling, please use proper grammar and spelling when postin
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    The double dots means "the directory above the current location" whereas the single dot means "the current directory".

    Comment

    • AnagJohari
      New Member
      • May 2010
      • 96

      #3
      Originally posted by drhowarddrfine
      The double dots means "the directory above the current location" whereas the single dot means "the current directory".
      can u please explain in detail , i am not getting the mean of directory above the current location

      Comment

      • drhowarddrfine
        Recognized Expert Expert
        • Sep 2006
        • 7434

        #4
        Paths are described using the scheme starting with '/' which indicates the beginning point, or 'root', of the path to the directory or file you are looking for. A name following root is the name of the file or directory, so /myfile points to the file 'myfile' from the top.

        If you are in a directory with the path /mydirectory/dir1/dir2 then '.' indicates the current directory (technically the node but let's not go there). While in dir2, if you were to indicate '..', that would mean to move up on level which would put you in dir1. You could even do ../.. which would move you up two levels and place your location in 'mydirectory' again. For that matter, just typing '/' puts you back to root.

        Comment

        • master99
          New Member
          • Apr 2010
          • 1

          #5
          its so simple
          double codes means image you use place in different directory.and single codes means image place in same directory..
          more CSS information and Higher Page Rank Guide see this site
          http://www.tutorials99 .com

          Comment

          Working...