4 Replies Latest reply on Jun 23, 2010 6:45 AM by LeslieInNC

    Can You Automatically Add the Same CSS Markup to Every HTML Export?

    oic.now Level 1

      I'm creating web page prototypes, not real web pages that serve as clickable visual aids for our design discussions.

       

      I would like all my prototope html pages to export from Fireworks CS4 without margins on top & left.  Is there some way to make it always insert a link to a stylesheet or insert this style:

       

      <style type="text/css">
      <!--
      body { margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0;
      padding:0; }
      -->
      </style>

       

      into every html page it exports?

        • 1. Re: Can You Automatically Add the Same CSS Markup to Every HTML Export?
          zeroskillz Level 3

          Yes, oddly enough.

          This issue was irritating the bejeezers out of me, so I muddled into the bowels of the application files and found the docs that Firworks uses to genetrate the HTML. they can be found here:

           

          C:\Program Files\Adobe\Adobe Fireworks CS4\Configuration\HTML Code\

           

          I default to the Dreamweaver HTML export thingy, so I opened the Dreamweaver folder, and found a file named:

           

          SLICES.XTT

           

           

          First thing, make a copy of that and name it old_SLICES.XTT or whatever, in case you inadvertanlty mess something up...

           

          Then open the original in notepad and search for this string:

          // close the body tag.

           

          Right below that line insert these three lines:

           

              WRITE_HTML("<style type=\"text/css\">");
              WRITE_HTML("body {margin: 0px;}");
              WRITE_HTML("</style>");

           

          Save and export. Voila!

           

           

          HTH

          -Ted

           

           

          Heres a bit more around that bit:

           

           

           

           

           

                  if (i>0) WRITE_HTML(");");
                  // Hey!  the order here is very important.  We should put the call to MM_preloadImages() first
                  //    because the javascript in FWLoadInit could return or cause sytax errors for any javascript
                  //    following it! (ajf - 3/27/2002)
                  WRITE_HTML(FWLoadInit);
                  WRITE_HTML("\"");
              }
              WRITE_HTML(">\n");    // close the body tag.
             
              WRITE_HTML("<style type=\"text/css\">");
              WRITE_HTML("body {margin: 0px;}");
              WRITE_HTML("</style>");

           

          }

           

          function WriteStyleSheets(curSlices, indent, topLevel) {
              var curCol;
              var curRow;
              var prevTop = 0;
              var prevLeft = 0;

          • 3. Re: Can You Automatically Add the Same CSS Markup to Every HTML Export?
            Dave Hogue Level 2

            This is a great example of the customizability and extensibility of Fireworks!

             

            If you know Javascript, you can go into nearly all of the commands and scripts and modify them to do what you need.

             

            Thanks for sharing.

            • 4. Re: Can You Automatically Add the Same CSS Markup to Every HTML Export?
              LeslieInNC

              zeroskillz,

               

              Do you know how to edit the Slices.xtt to prevent the IE7 vertical scrollbar as described in http://forums.adobe.com/message/1985467#1985467l?  I was successful in editing the  Slices.xtt file as described in this thread to remove the margins,  but I can't seem to get it to work with the style="overflow:auto"  added.