SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Jun 2013
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem connecting css and html

    i use notepad++ and i cant seem to link my css and html files.
    "<link rel="stylesheet" type="text/css" href="stephens/new 3.css" />"
    that is exactly what i have written in my html document and it still wont work.
    any suggestions?

  2. #2
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,880
    Mentioned
    74 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by stever1997 View Post
    i use notepad++ and i cant seem to link my css and html files.
    "<link rel="stylesheet" type="text/css" href="stephens/new 3.css" />"
    that is exactly what i have written in my html document and it still wont work.
    any suggestions?
    The href="stephens/new 3.css" path is a relative path.

    Try a link instead:

    HTML Code:
    <!-- SPACE NOT ALLOWED -->
    <link rel="stylesheet" type="text/css" href="http://yourSite.com/assets/css/stephens/new 3.css"  />
    
    <!-- VALID APACHE FILENAMES -->
    <link rel="stylesheet" type="text/css" href="http://yourSite.com/assets/css/stephens/new3.css"  />
    <link rel="stylesheet" type="text/css" href="http://yourSite.com/assets/css/stephens/new-3.css"  />
    <link rel="stylesheet" type="text/css" href="http://yourSite.com/assets/css/stephens/new_3.css"  />
    Also just noticed there is a space in the CSS filename which is not allowed on Apache Servers. Try removing the space (%20) or replacing the with a dash, hyphen or an underscore.
    Last edited by John_Betong; Jun 27, 2013 at 05:44. Reason: Noticed space (%20) in filename
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Wolfshade on earning Member of the Month for August 2014

  3. #3
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,658
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    I have not written out the link in 10 years. It's always just a template I made 10 years ago. Here is that template...

    <!DOCTYPE html><html><head><meta charset="UTF-8">
    <title>Initial html Settings</title>
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="author" content="">
    <meta name="copyright" content="">
    <link href="styles.css" rel="stylesheet" type="text/css">
    </head>
    <body>

    <div id="wrap">
    <div id="head"></div>
    <ul id="nav"></ul>
    <div id="content">
    <div id="left"></div>
    </div>
    <div id="foot"></div>
    </div>

    <script type="text/javascript" src="temp.js"></script>
    </body>
    </html>

  4. #4
    SitePoint Member
    Join Date
    Jun 2013
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the help lads but still no luck. any chance it could be the laptop im using?

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,296
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by stever1997 View Post
    thanks for the help lads but still no luck. any chance it could be the laptop im using?
    This is really easy to do, so you must be making a simple mistake, but we don't have enough info. What is your site structure? Also, avoid spaces in your file names and URLs. It makes for an awful mess. So make sure your file names are something like

    new3.css

    or

    new-3.css

  6. #6
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,658
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Undoubtably a path issue. Layout your path structure and show your css link to us.

    Example...

    Root = /
    /index.php
    /css/styles.css

  7. #7
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,880
    Mentioned
    74 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by stever1997 View Post
    thanks for the help lads but still no luck. any chance it could be the laptop im using?
    If you use html solution provided in post#2 and use Firefox to display the your page "View source". Clicking on the html link should display your CSS file if and only if the path is correct
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Wolfshade on earning Member of the Month for August 2014

  8. #8
    SitePoint Member
    Join Date
    Jun 2013
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok so i scraped everything i had on that document and started from scratch again and this time it worked thanks for the help!


Tags for this Thread

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
  •