SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Jun 2012
    Location
    Tallahassee, FL
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    External CSS file

    I'm a neopyhte to building a web site. I'm using the book by Ian LLoyd on building a web site. I can't get past page 80 because the Style1.css is not recognized by my web pages. The web pages and CSS file are in the same folder. i know all my coding is correct. Can you tell me why my web pages do not recognize Style1.css?

  2. #2
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,150
    Mentioned
    262 Post(s)
    Tagged
    5 Thread(s)
    Quote Originally Posted by pushornl View Post
    I'm a neopyhte to building a web site. I'm using the book by Ian LLoyd on building a web site. I can't get past page 80 because the Style1.css is not recognized by my web pages. The web pages and CSS file are in the same folder. i know all my coding is correct. Can you tell me why my web pages do not recognize Style1.css?
    Hi pushornl and welcome to the forums.

    The usual cause of this problem (we've all done it ) is a typo. If your file is called Style1.css, are you sure you haven't linked to style1.css from your HTML? If you can't spot an obvious error like that, then please post a link to your site, or post your full HTML and CSS code here, so we can take a look at it for you.

  3. #3
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,798
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    Welcome to Sitepoint, and nice to see you have chosen to take the red pill, NEOphyte

    Yes, links and css rules are case sensitive, so be careful.

    Also remember that the path to your CSS file is relative to the document. So if for some reason you have put this particular file in a sub folder.. you must account for that with "./" in your path structure.

  4. #4
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Yup, we've all done it. Except for me.

    Usually, I put my CSS files in their own dedicated folder, cleverly entited "css". So for a particular project, I might use the following code in my heading:

    Code CSS:
    <link rel="stylesheet" href="css/mystyles.css" type="text/css" media="screen">

    The href="css/mystyles.css" bit tells the HTML file where to find the CSS file.

  5. #5
    SitePoint Member
    Join Date
    Jun 2012
    Location
    Tallahassee, FL
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Techno bear. Your comment about the being sure that you have the complete web address, woke me up. I didn't have the HTML appended to the Style1.CSS file.
    Thanks again!

  6. #6
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,150
    Mentioned
    262 Post(s)
    Tagged
    5 Thread(s)
    Glad we could help.


Bookmarks

Posting Permissions

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