Setting up a stylesheet

August 10th, 2008

Css | Cascading Style Sheets

My post changing font color with css is getting quite a few hits, but it assumes a certain level of knowledge.
So here I will show you how to set up your style sheet.

Create index

Save document with meta information as shown, as index with .htm as the file extension.
You have your index.htm
within the head section you find the meta information.

<head> <title>MadLayout</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="author" content="Paul David Spencer" /> <meta name="description" content="What we do"/> <meta name="keywords" content="Design, CSS, Standards."/> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> </body> </html>

The highlighted part is where you need to make the link to the stylesheet.
I have called it style.css, but call it anything you will remember.

Create the stylesheet

Open your text editor and save empty page as style, (or whatever you chose) with .css as the extension, thus saving it as a css document.
Once saved you can check your link is working, by adding styles for the body of your index document.

body { margin: 0; padding: 0; background-color:#8b0000; }

Place index.htm and style.css in the same directory, test index in browser, and if your page background colour changes accordingly you are set, Ha ha.

Related Posts

Css Layout
Css Popup
Css Change font colour

Entry Filed under: CSS Reaction

3 Comments Add your own

  • 1. Change font colour using &hellip  |  September 5th, 2008 at 11:42 am

    [...] might need to set youeself a style sheet at this [...]

  • 2. Background | Oikofugic De&hellip  |  November 12th, 2008 at 12:52 am

    [...] larger backgrounds when placed behind a containing div of set width don’t cause any horizontal scroll bars, and [...]

  • 3. Recent Faves Tagged With &hellip  |  January 15th, 2009 at 8:50 pm

    [...] public links >> stylesheet Distributing First saved by tiqo | 10 days ago Setting up a css stylesheet First saved by chingz | 13 days ago Wow! An Update! First saved by jaydugger | 26 days ago [...]

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Most Recent Posts