I have used one CSS file to define link colors, decoration, etc. for multiple pages.
Can someone give me a quick example of using CSS to put the same img and text layout at the top of each page?
You have to link it to each page. I will show you what I did for my internship last year. Ignore that there are different photos in the header. The clientel wanted his page to be different but the same at the same time not look boring. But take a look at the Support Marketing Service words which is actually an image..I made it in photoshop. The div name is smsname . That is in it own div tag on every singe page. This is the link http://www.supportmarketingservices.com/
I will give you the code I ue for the company page, so that you can see how the code work, how I set up the header, sidebar, footer, and etc.
company.html page
<!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" />
<title>Company</title>
<!--[if IE]>
<style type="text/css">
/* place css fixes for all versions of IE in this conditional comment */
.twoColLiqLtHdr #sidebar1 { padding-top: 30px; }
.twoColLiqLtHdr #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
<link href="../company.css" rel="stylesheet" type="text/css" />
<meta name="Keywords" content="aparel, bags, totes, Writing Instruments, company, print, outings, business cards, cards, display, promotional, gifts, Eco-Friendly marketing material, sports, events, electronic, home, family, business, catalogue, service, marketing, support, portland, oregon, embroidery, custom, design, clothes, cup, mugs" />
<meta name="Description" content="Support Marketing Services provide Custom Design Apparels, Bags, Totes, Office Supplies, Business Cards, Displays, Electronic, and so much more for Businesses, Home, and Family. Request a Catalogue to see all products that Support Marketing Services provides." />
</head>
<body class="twoColLiqLtHdr">
<div id="smsname"><img src="2title.png" width="547" height="58" /></div>
<div id="container1">
<div id="header"><!-- end #header -->
<img src="headingcompany.jpg" alt="company informations" width="799" height="173" /></div>
<div id="sidebar1">
<div id="portfolios">
<ul>
<li><a href="../index.html">Home</a></li>
<li><a href="../apparel/apparel.html">Apparel/Headwear</a></li>
<li><a href="../bags_n_totes/bags_n_totes.html">Bags & Totes</a></li>
<li><a href="../writing_instruments/writing_instruments.html">Writing Instruments</a></li>
<li><a href="../display/display.html">Displays</a></li>
<li><a href="../eco_friendly/eco_friendly.html">Eco-Friendly</a></li>
<li><a href="../sport events/sportsevent.html">Sport Events</a></li>
<li><a href="../electronic/electronic.html">Electronics</a></li>
<li><a href="../cpuaccess/cpuaccess.html">Computer Accesories</a></li>
<li><a href="../catalog request/catalogreq.html">Catalog Request</a></li>
<li><a href="company.html">Company</a></li>
<li><a href="../contact/contact.html">Contact</a></li>
</ul>
</div>
<!-- end #sidebar1 --></div>
<div id="mainContent">
<h1>
<!-- end #mainContent -->Company</h1>
<p>Speciality Imprinted Promotional Products For All Your Needs! </p>
<p><strong>Support Marketing Services</strong>, has over 25 years of service in the industry of imprinted specialty promotional products. </p>
<p>Our extensive knowledge of imprinted specialty gifts puts companies on the cutting edge when using <strong>Support Marketing Services</strong> to purchasing products to promote your organization. </p>
<p>We focus on personalized professional service and provide top quality products, competitive pricing and prompt delivery. </p>
<p><strong>Call Now! </strong>USA Toll Free 1.866.272.0951 to speak with a representative</p>
<table cellspacing="0" cellpadding="0">
<tr>
<td valign="top" width="99%" bgcolor="#CCCCCC" colspan="3">From A to Z <strong>Support Marketing Services</strong> can provide you with all of the speciality imprinted products your organization requires.</td>
<td> </td>
</tr>
<tr>
<td valign="top" align="left" width="33%" bgcolor="white">A - G
Automotive Items
Awards/Eco-Friendly
Bags
Balloons
Bike Bottles
Bookmarks
Briefcases
Buttons
Cameras
Calculators
Calendars
Candy
Caps
Card Holders
Cell Phone Cases
Children's Items
Clocks
Computer Items
Coolers
Cube Pads
Desk Accessories
Flashlights
Fly swatters
Folders
Food Items
Fun Flyers
Glassware
Golf Items</td>
<td valign="top" align="left" width="33%" bgcolor="white">H - P
High lighters
Jackets
Jewelry
Key Tags
Kitchen Helpers
Knives
Lapel Pins
Letter Openers
Lighters
Litter bags
Luggage Tags
Magnets
Matches
Memo Books
Message Boards
Mouse pads
Mugs
Note Holders
Paperweights
Personal Care Aids
Pens
Pencils
Photo Albums
Picture Frames
Planners
Playing Cards
Post-It® Pads</td>
<td valign="top" align="left" width="33%" bgcolor="white">R - Z
Eco-Friendly Items
Ring Binders
Rulers
Shirts
Signs
Sports Products
Sports Bottles
Stadium Cups
Stress Balls
Stuffed Animals
Sunglasses
Tape Measures
Thermometers
Tools
Tote bags
Towels
Travel Kits
T-Shirts
Umbrellas
Wallets
Watches
Yardsticks</td>
</tr>
</table>
<!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats -->
</div>
<br class="clearfloat" />
<div id="footer">
<p><strong>Copyright © </strong>2008 Support Marketing Services, All rights reserved.
<a href="../catalog request/catalogreq.html">catalog request</a></p>
<!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>
company.css page
#smsname {
position:absolute;
left:239px;
top:124px;
width:480px;
height:48px;
z-index:1;
}
#portfolios ul {
font-size: 0.9em;
list-style: none;
margin-left: 0px;
margin-top: 0px;
padding-left: 0px;
}
#portfolios a:link {
color: #FFFFFF;
background: #cd8016;
/*#C0751A #C18330 */
text-decoration: none;
display: block;
padding: 2px;
padding-left: 32px;
width: 150px;
border-bottom: 1px solid #000;
padding-top: 6px;
}
#portfolios a:visited {
color: #FFFFFF;
background: #cd8016;
text-decoration: none;
display: block;
padding: 2px;
padding-left: 32px;
width: 150px;
border-bottom: 1px solid #000;
padding-top: 6px;
}
#portfolios a:hover {
color: #000000;
background: #FFFFFF;
text-decoration: none;
}
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
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: #000000;
background-color: #e5d9a6;
}
.twoColLiqLtHdr #container1 {
width: 800px;
margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
border: 1px solid #000000;
text-align: left; /* this overrides the text-align: center on the body element. */
background-color: white;
}
.twoColLiqLtHdr #container h1{
font-family:"Times New Roman", Times, serif;
font-size: 24px;
}
#header {
border: 1px solid #000;
border-right: 1px solid #000; /* 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. */
}
/* Tips for sidebar1:
1. since we are working in percentages, it's best not to use padding on the sidebar. It will be added to the width for standards compliant browsers creating an unknown actual width.
2. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".twoColLiqLtHdr #sidebar1 p" rule.
3. Since Explorer calculates widths after the parent element is rendered, you may occasionally run into unexplained bugs with percentage-based columns. If you need more predictable results, you may choose to change to pixel sized columns.
*/
.twoColLiqLtHdr #sidebar1 {
border: 1px solid #000;
font-family:"Times New Roman", Times, serif;
font-size: 18px;
float: left;
height: 1010px;
width: 184px; /* since this element is floated, a width must be given */
background: #CD8016; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 0; /* top and bottom padding create visual space within this div */
}
/* Tips for mainContent:
1. the space between the mainContent and sidebar1 is created with the left margin on the mainContent div. No matter how much content the sidebar1 div contains, the column space will remain. You can remove this left margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends.
2. to avoid float drop at a supported minimum 800 x 600 resolution, elements within the mainContent div should be 430px or smaller (this includes images).
3. in the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs.
*/
.twoColLiqLtHdr #mainContent {
margin: 0px 20px 0px 28%; /* the right margin can be given in percentages or pixels. It creates the space down the right side of the page. */
padding-bottom: 25px;
}
.twoColLiqLtHdr #mainContent h1{
text-align: left;
font-size:18px;
text-decoration: underline;
font-family:Verdana, Arial, Helvetica, sans-serif;
}
.twoColLiqLtHdr #footer {
padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background-color: #F9F8C4;
font-size: 80%;
text-align: center;
height: 45px;
}
.twoColLiqLtHdr #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 */
border: #000000;
}
/* Miscellaneous classes for reuse */
.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;
}