1. This website uses cookies. By continuing to use this website you are giving consent to cookies being used.
    For information on cookies and how you can disable them visit our Cookie Usage page.
    Dismiss Notice

CSS CSS Location Change Causing Problem

Discussion in 'Web Development' started by dmac, Nov 3, 2008.

  1. dmac

    dmac New Member

    Hello All,

    I have also been experiencing a problem when I change the location of the stylesheet to the images folder. I have the stylesheet in the images folder and have changed the location on the index page to :
    link href="images/style.css" rel="stylesheet" type="text/css" /

    Once the stylesheet location is changed from "style.css" to "images/style.css" all images that are called from the stylesheet do not appear. Only those images that are called directly from the index.html file are displayed.

    I'm also wondering if it's an issue with the html declarations:
    !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
    html xmlns="http://www.w3.org/1999/xhtml"
    head
    meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /

    All help is appreciated!
     
  2. ishkey

    ishkey Moderator, Logos, Sports Crests Staff Member Verified Member

    It has to do with, Virtual Path to Root ("relative path"). Can't remember off top of my head, but would be best just to leave the css file if you are working in html, in the root directory. If in php or asp, then it would be something like /common/css/file.css
     
  3. dmac

    dmac New Member

    Thanks, ishkey. Unfortunately, my host is forcing me to put the css file in the images folder and I have no control over that.
    If I'm not able to get this to work then I'm going to be forced to use another template or code from scratch.
     
  4. ishkey

    ishkey Moderator, Logos, Sports Crests Staff Member Verified Member

    I have never heard of a host forcing someone to put files in certain directories short of you putting your files into public_html. Please explain this one. Do you rent or is it free? Who is it so the rest of us can stay clear. If it is someone letting you use their web space, then have them set you up a sub-domain, that way you will have your own virtual space and will not interfere with them. I can't wait for this answer... It's got to be good!
     
  5. dmac

    dmac New Member

    My host is only offered within my niche industry and would not be available to outside companies. Their backend, which handles the database for my site, is extremely css heavy, which is why they have certain restrictions on where css files must be located.
     
  6. ishkey

    ishkey Moderator, Logos, Sports Crests Staff Member Verified Member

    Still doesn't make any sense to me. Sounds like you need a host who understands computers. Every file has a name and a extension. In html and css they work when you call them in the code, with the execption of the index or default html file which the server looks for. You could have as many external css files as your server can hold and the only work when called, end of story. You could load up the front end with just about any file you want and all they do is sit there just like on your pc waiting their turn to be displayed. Just trying to paint you a picture so you understand how servers work. Where do you put the rest of your files?