4 Replies Latest reply on Jan 24, 2013 12:15 AM by EagerBob

    CSS files does not appear to link

    dzdewilde Level 1

      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.

        • 1. Re: CSS files does not appear to link
          hans-g. Adobe Community Professional & MVP



          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:





          • 2. Re: CSS files does not appear to link
            EagerBob Level 2

            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





            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

            • 3. Re: CSS files does not appear to link
              dzdewilde Level 1

              Thanks for your suggestions. After reviewing the replies to my post, I contacted my web host about my "personal web space". They said that the site was limited to html only. The site didn't support fancy web authoring tools. I asked if they considered css files one of these (I certainly don't), and they said yes. I will be looking for a new web host soon. I was able to repost without a linked css file but still have long way to go in my attempts to learn html and Dreamweaver. Thanks again.

              • 4. Re: CSS files does not appear to link
                EagerBob Level 2

                I will be looking for a new web host soon.


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



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