Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Directories with a hyphen not being read by bachground-image:url(‘URL’)?

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #32073
    sattu94
    Member

    Hello
    I recently was trying to execute this piece of code:

    It worked as expected then.
    I then moved the image to D:kkdata.

    But it doesn’t work here.
    Just to make sure i created another folder with a hyphen in it’s name and moved the file to it:

    
    	
    #55020
    cybershot
    Participant

    so what is your question? if hyphens don’t work, don’t use them in the folder name

    #55024
    sattu94
    Member

    why don’t they work?
    it’s not consistent ..i should not have to change all of my folder structure. due to this
    If it is of any help this is the original snippet i am executing:

    #55081
    mixxmac
    Member

    You need to use a proper URL. Either an absolute URL (e.g. ‘http://www.mywebsite.com/tux-water.jpg’), or a relative URL (e.g. ‘tux-water.jpg’). Don’t reference the file path (e.g. ‘D:mywebsitetux-water.jpg’).

    #55082
    sattu94
    Member

    what if the file doesnt exist on the internet, what if it’s local ?
    Thanks for the answers.

    #55088
    mixxmac
    Member

    I guess you’d have to use a relative URL then (e.g. ‘tux-water.jpg’). Or, assuming you’re running a webserver (e.g. IIS on Windows), you should be able to browse to it using ‘localhost’ as the domain (e.g. ‘http://localhost/tux-water.jpg’). However, it’s best to use relative URLs, so I would stick with ‘tux-water.jpg’.

    #55089
    chrisburton
    Participant

    It is most likely because of where your image file is located. Remove the D: drive from the URL as that is not proper. Also, how are you working locally, as in what does your setup look like?

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.