• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Applying a CSS style to an existing web page

Explorer ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

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.

Views

22.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

<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_titleFo..."></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;
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

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 & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

for some reason, it didn't work.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

akanick

If the code pasted above is what you have in your actual external stylesheet, it won't work.

You cannot have html tags in an external stylesheet.

All of this needs to be removed from the .css file...

<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_title..."></script>

The link in your pages to your external stylesheet should then look like this...

<link rel="stylesheet" type="text/css" media="screen" href="main_layout.css" />

You should also replace the space in "main stylesheet.css" with an underscore as shown above.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

OK, styling with CSS 101:

An external style sheet is linked or imported with a page.

Since the style sheet is a cascading style sheet, stuff at the end of your style sheet will override stuff at the beginning of the style sheet.

And any styles you include within your page will override any styles established in your style sheet.

So, if what you are trying to do is make all pages look like the new styles defined in CSS, you must put those style changes in your external stylesheet that is imported with all of your pages. Or, you must put those styles in all pages. Frankly, the purpose of an external style sheet is to reduce the code within each page and to allow you to be consistent across all of your pages.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

So, if what you are trying to do is make all pages look like the new styles defined in CSS, you must put those style changes in your external stylesheet that is imported with all of your pages.

Yes! This is what I'm trying to do. How do I do it?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

Open your external style sheet in Dreamweaver.

Copy the styles that you wish to make common to all web pages.

Paste into the external stylesheet. Save the document and upload it to the server.

You're done.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

Okay. How do I create/save an external style sheet?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

Do you see this in your code?

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

There is a stylesheet on your site (as you have defined it locally and remotely) called MAIN LAYOUT.css. That is your external style sheet.

Now, just as an aside, I would not use spaces in the name of a file to be placed on an Unix Server, as some computers on the internet may not exactly know what to do with the space. If you rename the file, which is in the same folder as the file you copied the code from, within Dreamweaver, Dreamweaver will ask you if you want to update other pages that use that file. You do.

So find MAIN LAYOUT.css and first rename it (I recommend layout.css), then copy the code from your web page and paste into layout.css. You can have multiple documents open a tthe same time in Dreamweaver. They'll show up as tabs. So you can tab from one to the other quickly.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

I'm confused. You're telling me to copy the code from my existing web page into my main layout.css document? To me it doesn't make any sense. Where would I paste it?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

OK, maybe I'm not explaining this right.

Tell me the file name that you copied the code from.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

Okay, so I have a CSS file called layout.css. (I changed the name of it at your advisement). It is not applied to any sheet yet. I have a whole entire existing web site that is set up with a different style using HTML coding. I would like to apply my new layout.css to all of my existing pages.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

On ALL HTML pages of your website, change this -

</head>

to this -

<link rel="stylesheet" href="path_to_layout.css" type="text/css">

</head>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

It's still not working, but if it matters, there are some div tags within the <head> </head> area. I'm beginning to think I'd be better off just re-doing all of my HTML pages.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

You cannot have <div> tags within <head> areas! It's an invalid construct.

Better show us one of your pages, please.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

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>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

So basically, I don't feel like I know what I need to do in this situation. I have created all these pages a while back, and at one time I was fooling around with creating templates, before I learned of the concept of css, and I'm pretty sure I ended up saving some or all of these pages as templates, which was a mistake... The bottom line, it's not a big deal for me to start over. I just don't know which type of file I should use. HTML, CSS, etc...it's all so confusing. I'm self taught with everything I know, and to tell you the truth, I know more about HTML than anything.

Murray: This is a different page than what I was working with in the previous posts, so, no,  I didn't make the change on this page, because it didn't work on my last page.  By all means, tell me the best direction to go from here, and I'll do it! Thanks in advance.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

The best direction to go in is to close DW. Take the time to learn HTML and CSS so that you are comfortable with the ideas and concepts.  Once you do that DW will be a walk in the park instead of a ginding, uphill slog.  Notwithstanding this, though, you can just open this page in DW, and change this -

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

<title>Home Page</title>

<!-- TemplateEndEditable -->

to this -

<title>Home Page</title>

DW will no longer consider this page a template once you do that.  Repeat that process on other similarly affected pages.

Now - where to go from here?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

Take some time to go through this tutorial, it should help make connecting to an external .css file clear to you...

http://www.w3schools.com/css/default.asp

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

Murray, I made both changes you suggested to this particular page. And still nothing happened. Below is the coding between the two "head" tags.

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Home Page</title>

<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 -->
<link rel="stylesheet" href="path_to_layout.css" type="text/css">

</head>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 29, 2012 Nov 29, 2012

Copy link to clipboard

Copied

If I was to start over, which I'm assuming at this point I'll have to, what type of new blank page works best with the any CSS layouts I will create? Does it matter? Or is it just a matter of preference?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines