3 Replies Latest reply on Jul 13, 2015 7:07 AM by Jon Fritz II

    CSS code defaulting to html page DW CC

    GoGood

      Hi,

       

      I am trying to create a site from a blank html page and no matter what I do, Dreamweaver keeps placing the CSS code in the head of the HTML page. I don't want this as the site will have more than one page and I would like a site wide css file.

       

      I have created a new HTML page, selected create a new CSS, named the css to what I want and still it places the css in the html file.

       

      I have tired right clicking the page in design view and adding the css file and still the same.

       

      I have never had this issue before, it seems as if the latest update to Dreamweaver (one where is default adds JS and font folders) seems to be doing something that will not allow design view to place code directly into an external CSS file.

       

      The correct href links are in the head tags for the CSS file.

       

      It is driving me mad.

       

      Many Thanks

        • 1. Re: CSS code defaulting to html page DW CC
          Jon Fritz II Adobe Community Professional & MVP

          Be sure you have the external css file highlighted in the Sources panel of the CSS Designer window before you add a new class or id under the  Selectors panel...

           

          css-designer.jpg

          1 person found this helpful
          • 2. Re: CSS code defaulting to html page DW CC
            GoGood Level 1

            Hi Jon Fritz II

             

            Thank you for the reply.

             

            I highlighted the css file as suggested and then went to page properties to change the margins to 0, it still places the css code in the html file. I know I can copy this code to the actual CSS file but there is no option at all to select where to place the code.

             

            I have figured out, from your post above that what I was missing when creating new div tags, is that when you go via the insert route and then enter the ID of the rule and click create New CSS Rule, on the second box that give the options for if this applies to one or all html elements, right at the bottom, there is a drop down box for where to place the code - source file (the html page), New CSS file or the name of any CSS file in the root.

             

            I don't remember having this trouble with previous versions of DW, when an HTML file was created it would ask how you wanted to use the CSS code/files and all would be good form there.

             

            If you know how to default the page properties CSS code to got to the external style sheet that would be great.

             

            Thanks for your help.

            • 3. Re: CSS code defaulting to html page DW CC
              Jon Fritz II Adobe Community Professional & MVP

              GoGood wrote:

               

              Hi Jon Fritz II

               

              Thank you for the reply.

               

              I highlighted the css file as suggested and then went to page properties to change the margins to 0...

               

              "Well there's your problem..."

               

               

               

              Page Properties are literally "the properties of the page". If you want to add body {margin:0;} to your external .css file, you need to make the change  in the CSS Designer. Page Properties affect only the given page and will write to the <head> section as Embedded CSS.