Path

ez.no / exponential / documentation / building an exponential site / setting up the main layout / creating and using a custom style sheet


Creating and using a custom style sheet

These documentation pages are no longer maintained. Please visit the new documentation site.

So far we have only set up some basic things without generating any remarkable visual output. Lets add some custom CSS code and tell the main template to use it. The following parts of the tutorial will heavily depend on the CSS code presented in this section, so make sure you do this part right.

The CSS code will tell the browser to use a custom background image, called "background.png". This image file is available from the following link: background.png. Grab and save the image as "design/tscm/images/background.png". Make sure that the webserver can read the image (e.g. chmod a+r background.png).

Creating a custom CSS file
Copy & paste the following lines (from the box below this text) and save the file as "design/tscm/stylesheets/tscm.css".

body

{

   background-color: #ffffff;

   background-image: URL("../images/background.png");

   background-repeat: repeat;

}

 

p

{

   font-size: 80%;

}

 

td

{

   font-size: 100%;

}

 

hr

{

   height: 0px;

}

 

a

{

   color: #444444;

}

 

a:visited

{

   color: #666666;

}

 

a:hover

{

   color: #aaaaaa;

}

 

.main

{

   width: 732px;

   margin-left: auto;

   margin-right: auto;

}

 

.border

{

   color: #ffffff;

   background-color: #333333;

}

 

.menu

{

   width: 80%;

   background-color: #474747;

   margin-left: auto;

   margin-right: auto;

   text-align: center;

   font-size: 80%;

   padding: 2px;

}

 

.menu a

{

   color: #cccccc;

}

 

.menu a:visited

{

   color: #bbbbbb;

}

 

.menu a:hover

{

   color: #eeeeee;

}

 

.content

{

   padding: 32px;

   text-align: left;

}

 

.footer

{

   color: #bbbbbb;

   background-color: #333333;

   padding: 4px;

   text-align: center;

   font-size: 70%;

}

 

.footer a

{

   color: #eeeeee;

}

 

.footer a:visited

{

   color: #eeeeee;

}

 

.footer a:hover

{

   color: #ef8e00;

}

 

.pagetitle

{

   font-size: 170%;

   padding-bottom: 8px;

}

Using the custom CSS file
Edit the main template file ("design/tscm/templates/pagelayout.tpl"). In the head section, add the following code after the already existing stylesheet-related lines:

<link rel="stylesheet" type="text/css" href={"stylesheets/tscm.css"|ezdesign} />

This line will tell Exponential to make use of the custom CSS file that we just created.

After you refresh the TSCM page in the browser. You should see that the background has changed from plain white to grayish vertical stripes. (If the background does not change, try to clear the cache.)

Comments

Contents

Building an Exponential site

Prerequisits
Situation
Creating the TSCM site
Testing the interfaces
Setting up the main layout
    Creating a bare-bone main template
    Creating and using a custom style sheet
    Customizing the main layout
Creating sections
The welcome page
The news page
The members page
The guestbook
The links page


Created

20/10/2003
2:07:56 pm
by Ole Morten Halvorsen

Last updated

23/11/2004
2:02:19 pm
by Raymond Bosman

Authors

Ole Morten Halvorsen
Balazs Halasy
Hannes Lilljequist
Raymond Bosman



This page is part of the Exponential documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.