Skip to main content
akanick
Participating Frequently
November 29, 2012
Question

Applying a CSS style to an existing web page

  • November 29, 2012
  • 2 replies
  • 24018 views

Hi all.

I have recently updated the look of one of my web pages in my site. I'm looking to update the look of the other pages in my site as well to the same style/look. I have a CSS style saved as  "main layout" that I would like to use to apply the same look my existing pages. I'm working in Dreamweaver CS4. Does anyone know how to go about doing this? I realize that, because the existing page already has a layout applied to it, that the look may not be exactly the same, and that's fine, I can work with it from there if I can get it to that point. I feel like there should be an obvious answer to this, but i can't find one.

Any help is greatly appreciated.

Thanks.

    This topic has been closed for replies.

    2 replies

    Nancy OShea
    Community Expert
    Community Expert
    November 29, 2012

    Link HTML pages to your external style sheet in DW.

    http://alt-web.com/DEMOS/DW-Link-Stylesheet.shtml

    Nancy O.

    Nancy O'Shea— Product User & Community Expert
    akanick
    akanickAuthor
    Participating Frequently
    November 29, 2012

    for some reason, it didn't work.

    MurraySummers
    Inspiring
    November 29, 2012

    This is one of my old pages.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Home Page</title>
    <!-- TemplateEndEditable -->
    <style type="text/css">
    <!--
    body  {
    font: 100% Verdana, Arial, Helvetica, sans-serif;
    background: 000000;
    margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
    padding: 0;
    text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
    color: #FFFFFF;
    background-color: #000000 ;
    border: 10 px;
    background-image: url(<img src="Graphics/blackbg.jpg" width="1024" height="658" />);
    }
    .twoColFixLtHdr #container {
    width: 80%;  /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
    background: #000000;
    margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
    border: 25px solid #000000; /* this overrides the text-align: center on the body element. */
    }
    .twoColFixLtHdr #header {
    background: #000000;
    padding: 0 0px 0 0px;  /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
    border: 1px solid #000000
    }
    .twoColFixLtHdr #header h1 {
    margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
    padding: 0px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
    }
    .twoColFixLtHdr #sidebar1 {
    float: left; /* since this element is floated, a width must be given */
    width: 200px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
    height: 825px;
    background: #000000 ; /* the background color will be displayed for the length of the content in the column, but no further */
    padding: 15px 10px 15px 20px;
    border: 15px solid #111111;;
    }
    .twoColFixLtHdr #mainContent {
    margin: 0 0 0 25px; /* the left margin on this div element creates the column down the left side of the page - no matter how much content the sidebar1 div contains, the column space will remain. You can remove this margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends. */
    padding: 0 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
    }
    .twoColFixLtHdr #footer {
    padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
    background:#DDDDDD;
    color: #000;
    font-size: small;
    text-align: center;
    font-weight: bold;
    }
    .twoColFixLtHdr #footer p {
    margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
    padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
    }
    .fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
    float: right;
    margin-left: 8px;
    }
    .fltlft { /* this class can be used to float an element left in your page */
    float: left;
    margin-right: 8px;
    }
    .clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
    clear:both;
        height:0;
        font-size: 1px;
        line-height: 0px;
    }
    body,td,th {
    font-family: Tahoma, Geneva, sans-serif;
    color: #FFF;
    text-align: center;
    }
    a:link {
    color: #D1FFF0;
    }
    a:visited {
    color: #903;
    text-align: center;
    }
    .twoColFixLtHdr #container p {
    color: #CCC;
    font-size: x-large;
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
    text-align: center;
    font-weight: bold;
    }
    .twoColFixLtHdr #container #sidebar1 table tr td h2 strong em {
    color: #fdf5e6;
    font-size: x-large;
    font-family: Tahoma, Geneva, sans-serif;
    text-align: left;
    }
    .twoColFixLtHdr #container #sidebar1 table tr td h2 em strong {
    color: #fdf5e6;
    font-size: x-large;
    text-align: left;
    }
    .twoColFixLtHdr #container #sidebar1 table {
    color: #D1FFF0;
    }
    .Maroon {
    color: #4a0019;
    }
    .maroon {
    color: #4a0019;
    }
    .sidebarfont2 {
    color: #d1fff0;
    }
    .twoColFixLtHdr #container #sidebar1 table tr td strong center strong {
    color: #d1fff0;
    }
    a {
    font-family: Palatino Linotype, Book Antiqua, Palatino, serif;
    }
    .twoColFixLtHdr #container center div p a {
    font-weight: normal;
    }
    .twoColFixLtHdr #container center div p em {
    font-size: 18px;
    }
    -->
    </style><!--[if IE 5]>
    <style type="text/css">
    /* place css box model fixes for IE 5* in this conditional comment */
    .twoColFixLtHdr #sidebar1 { width: 230px; }
    </style>
    <![endif]--><!--[if IE]>
    <style type="text/css">
    /* place css fixes for all versions of IE in this conditional comment */
    .twoColFixLtHdr #sidebar1 { padding-top: 30px; }
    .twoColFixLtHdr #mainContent { zoom: 1; }
    /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
    </style>
    <![endif]-->
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    </head>

    <body class="twoColFixLtHdr">

    <div id="container">
      <div id="header">
        <h1><img src="../../Graphics/logo.jpg" width="145" height="93" /><img src="../../Graphics/black-seafoam banner.jpg" width="910" height="127" /></h1>
      <!-- end #header -->
        </h1>
      </div>
      <p><div id="sidebar1">
        <table width="200" border="0" align="center" cellpadding="2" cellspacing="2" bg="bg">
          <tr>
            <td width="166" height="0" align="center" valign="middle" bgcolor="#4a0019"><h2>
              <center>
                <strong><em>Main Menu</em></strong>
              </center>
            </h2></td>
          </tr>
          <tr>
            <td><a href="../../index.html">Home</a></td>
          </tr>
          <tr>
            <td><strong><a href="../../Main Menu/MJSNC Staff/STAFF.HTML">
              <center spry:hover="SIDEBARFONT">
                Staff
              </center>
            </a></strong></td>
          </tr>
          <tr>
            <td><strong><a href="../../Main Menu/MJSNC Board of Directors/mjsnc board of directors.html">
              <center>
                Board of Directors
              </center>
            </a></strong></td>
          </tr>
          <tr>
            <td><strong><a href="../../Main Menu/MJSNC Newsletter/mjsnc newsletter.html">
              <center>
                Newsletter
              </center>
            </a></strong></td>
          </tr>
        </table>
       
        <p> </p>
        <table width="200" border="0" cellpadding="2" cellspacing="2">
          <tr>
            <td width="168" bgcolor="#4a0019"><h2><strong><em><center>Programs & Services</center></em></strong></h2></td>
          </tr>
          <tr>
            <td><strong><a href="../Education and Therapy/education and therapy program.html"><center>Education & Therapy</center></a></strong></td>
          </tr>
          <tr>
            <td><a href="../Support Services/Services.html"><strong> <center>Services</center></strong></a></td>
          </tr>
          <tr>
            <td><strong><a href="Adult Training Facilities.html"><center>Adult Training Facilities</center></a></strong></td>
          </tr>
          <tr>
            <td><a href="../Social Recreation/social recreation.html"><strong><center>Social Recreation</center></strong></a></td>
          </tr>
          <tr>
            <td><strong><a href="../Early Intervention/early intervention.html"><center>Early Intervention</center></a></strong></td>
          </tr>
          <tr>
            <td><strong><a href="../Family Living Program/family living program.html"><center>Family Living Program</center></a></strong></td>
          </tr>
        </table>
     
        <p> </p>
        <table width="200" border="0" cellpadding="2" cellspacing="2">
          <tr>
            <td width="168" bgcolor="#4a0019"><h2><em><strong><center>What's Happening?</center></strong></em></h2></td>
          </tr>
          <tr>
            <td><a href="../Challenger Division Baseball/Challenger Main Page.html"><strong><center>Challenger Division</center></strong></a></td>
          </tr>
          <tr>
            <td><strong><a href="../../Whats Happening/Summer Recreation/Summer Rec.html"><center>Summer Recreation</center></a></strong></td>
          </tr>
          <tr>
            <td><strong><a href="../../Whats Happening/LIP SYNC 2012/Lip Sync 2011.html"><center>Annual Lip Sync'</center></a></strong></td>
          </tr>
        </table>
      <p> </p></div>
      <table width="700" border="2" cellspacing="2" cellpadding="1">
        <tr>
          <td><p>Adult Training Facilities</p>
            <p> </p>
            <p>MARCELLA GANOE CENTER- </p>
    <p>439 SOUTH JUNIATA STREET LEWISTOWN,  PA 17044</p>
            <p><img src="../../Graphics/white-black flower.jpg" width="160" height="156" /></p>
            <p>COMPASS CORNER-</p>
            <p>31 SOUTH DORCAS STREET LEWISTOWN, PA 17044 </p>
    <p> </p>
            <p>The Mifflin-Juniata Special Needs Center has two Adult  Training Facilities in operation. The Marcella Ganoe Center, located at 439  South Juniata Street & Compass Corner, located at 31 South Dorcas Street.  Both facilities operate year round, five days per week. </p>
          <p>This program is designed to maximize an individual's  opportunity to participate in their community. Staff serves as adult role  models and challenges each participant to reach their highest level of ability  in daily living skills, social and physical development and interactions with  others.</p></td>
        </tr>
      </table>
      <p align="center"> </p>
      <p align="center"> </p>
      <table width="700" border="2" cellspacing="2" cellpadding="1">
        <tr>
          <td><img src="../../Graphics/Ganoe 2.jpg" width="448" height="322" /></td>
          <td><img src="../../Graphics/compass 5.jpg" width="504" height="346" /></td>
        </tr>
        <tr>
          <td><img src="../../Graphics/compass 1.jpg" width="424" height="323" /></td>
          <td><img src="../../Graphics/Ganoe Thank you.jpg" width="492" height="346" /></td>
        </tr>
      </table>
      <p align="center"> </p>
      <p align="center"> </p>
      <blockquote> </blockquote>
      <center>
      <p> </p>
      <div style="text-align: center; border-top: 2px solid #999; margin-top: 1em;">
        <p><a href="../../index.html">Home</a> • <a href="Main Menu/Contact Us/Contact Us.html">Contact Us • Map & Directions</a> • <a href="../../Main Menu/About Us/About Us.html">About Us</a></p>
      </div>
    </center>
    <hr />
    <font face=papyrus><center></center></font></div>
    </body>
    </html>


    This file is a DW template file?

    <!-- TemplateBeginEditable name="doctitle" -->

    I hope so otherwise you have problems (I don't see any sign of an editable region in the body though <shiver>)!

    I also don't see any attempt to make the change I suggested.  Can you clarify these issues?

    MurraySummers
    Inspiring
    November 29, 2012

    I have a CSS style saved as  "main layout"

    What does this mean?  Do you mean that you have a CSS stylesheet file that is saved as "main layout.css"?

    Show us what this style is, please, and we'll be able to answer better.

    akanick
    akanickAuthor
    Participating Frequently
    November 29, 2012

    Yes, sir. That is what I meant. How would you like me to show you what the style is?

    akanick
    akanickAuthor
    Participating Frequently
    November 29, 2012

    <style type="text/css">

    @import url("MAIN LAYOUT.css");

    </style>
    <p>guest book</p>
    <p> </p>
    <script src="//www.gmodules.com/ig/ifr?url=http://gadgets.fourthfloorequipment.com/guestbooker.xml&up_gbstr=DEMO&up_respOrder=oldest&up_titleFontSize=14px&up_titleFontColor=black&up_msgFontSize=12px&up_msgFontColor=black&up_linkColor=blue&up_respFontSize=12px&up_respFontColor=red&up_bgcolor=white&synd=open&w=700&h=500&title=MJSNC+Guestbook&border=%23ffffff%7C0px%2C1px+solid+%23998899%7C0px%2C1px+solid+%23aa99aa%7C0px%2C2px+solid+%23bbaabb%7C0px%2C2px+solid+%23ccbbcc&output=js"></script>.twoColFixRtHdr #container #sidebar1 table caption {
    font-size: x-large;
    }
    * {
    margin: 0px;
    padding: 0px;
    height: auto;
    width: auto;
    }
    #wrapper {
    margin: auto;
    text-align: left;
    width: 800px;
    background-color: #FFFEE8;
    border-top-color: #666;
    border-right-color: #666;
    border-bottom-color: #666;
    border-left-color: #666;
    border-right-width: 1px;
    border-left-width: 1px;
    border-right-style: solid;
    border-left-style: solid;
    }
    a img {
    border-top-style: none;
    border-right-style: none;
    border-bottom-style: none;
    border-left-style: none;
    text-align: center;
    }
    #wrapper #Logo {
    height: 180px;
    background-color: #FFFEE8;
    border-top-style: none;
    border-right-style: none;
    border-bottom-style: none;
    border-left-style: none;
    width: 800px;
    }
    #wrapper #headerImg {
    height: 350px;
    background-repeat: no-repeat;
    background-position: center center;
    text-align: center;
    vertical-align: middle;
    width: 800px;
    }

    #wrapper #Navigation {
    height: 20px;
    font-size: 14px;
    margin-left: 6px;
    width: 800px;
    }
    #wrapper #bodyarea #left {
    width: 700px;
    float: none;
    padding: 1px;
    height: 250px;
    clear: none;
    overflow: auto;
    text-align: center;
    border: 0px none #FFF;
    background-image: url(../Graphics/footer%20pic.jpg);
    background-repeat: no-repeat;
    background-position: center center;
    vertical-align: middle;
    }
    #wrapper #bodyarea #footer {
    height: 150px;
    clear: both;
    text-align: center;
    background-image: url(../Graphics/MORGAN%27S%20PIC.jpg);
    }
    p {
    font-family: "copperplate gothic light";
    font-size: 12px;
    font-style: normal;
    color: #333;
    }
    #wrapper #bodyarea table tr td #sidebar {
    margin: 0px;
    padding: 2px;
    float: right;
    height: 400px;
    width: 250px;
    }
    #wrapper #headerImgRIGHT {
    height: 400px;
    width: 400px;
    background-color: #0FF;
    position: fixed;
    color: #36C;
    border: medium groove #96F;
    }