Skip navigation
dzdewilde
Currently Being Moderated

CSS files does not appear to link

Jan 21, 2013 8:31 PM

Tags: #background #color #dreamweaver #link #css

I have created a simple site from scratch in Dreamweaver 6 (mac) using one of the software templates and uploaded it. The header, footer and body should have a black background. The typeface and alignment are wrong. It looks to me that there is a break in the link to the css file.

 

The site appears fine when previewing in the browser thru Dreamweaver but when I upload the file the css does not work. I had no problem building a site and uploading it for my class (different server) but when I try to upload my own . . .

 

This is my site address: http://home.ca.astound.net/~m.dewilde/

 

I would appreciate any help.

 
Replies
  • Currently Being Moderated
    Jan 22, 2013 4:08 AM   in reply to dzdewilde

    Hi,

     

    are you sure, that you loaded up your style.css to your server. Searching for it with: http://home.ca.astound.net/~m.dewilde/style.css, I got this:

     

    @charset "UTF-8"; body { font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif; background-color: #000000; margin: 0; padding: 0; color: #000; } .container { } .container { } ul, ol, dl { padding: 0; margin: 0; } h1, h2, h3, h4, h5, h6, p { margin-top: 0; padding-right: 15px; padding-left: 15px; color: #CCC; text-align: center; } a img { / border: none; } a:link { color:#414958; text-decoration: underline; } a:visited { color: #4E5869; text-decoration: underline; } a:hover, a:active, a:focus { text-decoration: none; } .header { background-color: #000000; } */ .content { padding: 10px 0; text-align: center; } .content ul, .content ol { padding: 0 15px 15px 40px; } .footer { padding: 10px 0; background-color: #000000; text-align: center; } .fltrt { float: right; margin-left: 8px; } .fltlft { float: left; margin-right: 8px; } .clearfloat { clear:both; height:0; font-size: 1px; line-height: 0px; }

     

    what means there must be a wrong name for it in your directory.

     

    I copied this from above into a new style.css and together with your source code from index.html I got this in live view:

     

    drWild.JPG

     

    Hans-Günter

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 22, 2013 2:05 PM   in reply to dzdewilde

    If you inspect your page with Firefox Web Developer tool (get that!) you'll see a warning:

     

    [13:36:48.725] The stylesheet http://home.ca.astound.net/~m.dewilde/style.css was not loaded because its MIME type, "text/html", is not "text/css". @ http://home.ca.astound.net/~m.dewilde/

     

    so either you have an error in your HTML (seems ok to me) or you need to add that MIME type to your webserver so that it will send the right content-type with the .css file.

     

    if you are on a Apache server add this to your .htaccess:

     

    AddType text/css .css

     

     

    /edit:

     

    Since you are using the HTML5 doctype you can safely omit the type="text/css" bit

     


    try <link rel="stylesheet" href="style.css" >

     

    not that I expect this to make a difference, but since the confusion seesm to be about the MIME type worth trying

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 24, 2013 12:15 AM   in reply to dzdewilde

    I will be looking for a new web host soon.

    right,

    a webhost that does not support external stylesheets is not really a webhost.

     

     

    don't forget to mark helpful answers as "helpful"

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points