Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I can't link CSS in my HTML?

    I've been having this problem for a while, but since i'm starting to stlye a lot more I can't seem to link this together? Or even import images? I know i'm doing it right because I double-checked I was doing it right on http://www.w3schools.com/html/html_images.asp
    anyways. I can use the style tag for styling but this doesn't work?
    Code:
    <link rel="stylesheet" href="css/slider.css">
    Do I need to get hosted?

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,475
    Thanks
    6
    Thanked 980 Times in 953 Posts
    You need to check if the file path is correct. With the current set-up (and assuming your images are in an own directory in the root directory) your file structure should look like:
    Code:
    |-html file
    |-css directory
    |   |
    |   css file
    |
    |-images directory
        |
        your images
    And also your file paths inside the stylesheet must be correct. With the above file structure, references to images in the stylesheet should look like: ../images/yourimage.png
    Last edited by VIPStephan; 07-26-2013 at 06:34 PM.

  • #3
    New Coder
    Join Date
    Jun 2013
    Posts
    34
    Thanks
    1
    Thanked 2 Times in 2 Posts
    use relative path

    <link rel="stylesheet" type="text/css" href="../css/slider.css">


  •  

    Tags for this Thread

    Posting Permissions

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