Using CSS Style Sheets to Modify Templates

Write your "How To" regarding anything you are comfortable with and you feel it will help the forum members.

NOTE :: All threads started here will appear only after the approval from Administrator
Post Reply
barnes
Posts: 202
Joined: Tue May 16, 2006 5:09 am

Using CSS Style Sheets to Modify Templates

Post by barnes »

This a tutorial geared for absolute beginners running forum software like phpNuke, Wordpress, phpBB, and SMF. This type of software uses themes, or templates to modify the appearance of the website. While these themes may appear to be very complex, they are designed for simplicity, and are extremely well designed when you start to get to know them.

The system changes between software. They use different files to display different things, but they mostly function on the same basis. You can not integrate themes for one software, to another. (Not easily at least.)

One way the software attempts to simplify the themes, is the use of CSS, or Cascading Style Sheets. CSS is a programming language built for designers, and integrates with HTML seamlessly. CSS is elegantly simple, and a lot of fun to use.

While CSS is very simple, I can not teach it all in one tutorial. This tutorial is an introduction to CSS, and how it is applied to PHP Software.

With CSS we can modify the font sizes, color, link colors, background colors, etc. on one single sheet. What CSS does at is core, is define the looks of basic HTML tags. For example, you can modify the color, and font of all paragraph blocks in HTML, with one single definition, rather then defining it every time you open a new paragraph block. You will find that this is a godsend, and will make the once tedious chore of changing a look, almost effortless.

To begin, you should have software installed on your server. For my example, I will be using SMF, though most of my instruction can easily be morphed into other software packages.

Select a theme you would like to modify. Any theme should work. Look for a theme that you like, but would like to change the details of, like fonts, colors, etc. For my example, I will be using the SMF Default theme.

Image
This is my theme to begin.

The next step is to reach inside the them and grab out the CSS Style Sheet. These are usually located at something like 'themes' or 'templates' and are commonly named style.css or stylesheet.css. CSS uses the file type as CSS...respectably. Download the style sheet, and open it in your favorite editor. Anything will work, Notepad, Dreamweaver, Nvu (Open Source web authoring suite. Awesome Dreamweaver/Frontpage alternative.) I will be using Dreamweaver.

'/public_html/games/Themes/default/' I found my theme file at this location. (I am using Filezilla

Once you open up your CSS sheet, you might be a bit confused. Relax, is very simple. You should recognize some of the gibberish on your screen, like 'a:link', which refers to the '<a href>' tag in HTML. This is defining the characteristic for the '<a href>' tag, each time it appears in the web site.

Image
The nonsense should look like this.

Lets experiment a little bit. Look for a tag that you understand. Using my example of a:link again, from the photo above, you can see that its color is defined as #476C8E. This number represents a shade of color that will be applied to all links on the site. Try changing this color. You do not have to use the number method of picking out a color, though I suggest that you do. You can get a larger range of colors using it. I changed the color to green.

Image
Notice the change to 'green'.

Save you style sheet, and upload it to its original location, and overwrite. Refresh your site, and notice that the link colors have changed. Sure, a simple change, but a proof of concept of how simple it it to modify. Play around with everything on your style sheet. Learn what everything edits, and make something original.]

Image
The final product.

Thanks for reading everyone. I hope it helps, and I can't wait to see what you all turn out! Thanks again! Have fun.


SHAdmin
Posts: 2089
Joined: Sat Dec 18, 2004 11:28 am
Contact:

Post by SHAdmin »

You have been credited 40 points for sharing the 'How To'.
Alishagoodgirl
Posts: 4
Joined: Fri Jun 15, 2007 3:59 pm

Post by Alishagoodgirl »

Good info. bro. keep going..............
barnes
Posts: 202
Joined: Tue May 16, 2006 5:09 am

Post by barnes »

Alishagoodgirl wrote:Good info. bro. keep going..............
Video tutorial on advanced CSS coming later.
Post Reply