SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: Stinkin Style Sheets...HELP!!!
-
May 16, 2000, 12:33 #1
- Join Date
- May 2000
- Posts
- 229
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
all im tryin to do is create a few small things.
i want the title of each of my news posts to be a certain color, font, and size.
i want the subtitle (like date & time of news post) to be another size and font
and i want the text paragraphs to be another size.
i dont want to change the font of the entire site (i like my links and nav bar to be different)
what route would you recommend i use?
external style sheet?
style classes?
im new to it all and getting frustrated =(
-
May 16, 2000, 13:51 #2
- Join Date
- Apr 2000
- Location
- Melbourne, Australia
- Posts
- 2,571
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
An external Style Sheet would seem to be your best bet.
Create a file called styles.css with the following contents (adjust values to preference):
<BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
.newstitle {
color: #0000FF;
font-family: Verdana, Arial, sans-serif;
font-size: 20px;
}
.newssubtitle {
font-family: Verdana, Arial, sans-serif;
font-size: 10px;
}
.newsbody {
font-size: 14px;
}
[/code]
That's your stylesheet. Link it to your HTML files by adding the following to their headers (between <HEAD> and </HEAD> ):
<BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
<LINK REL=STYLESHEET HREF="styles.css">
[/code]
Adjust the HREF attribute as you would any other link if styles.css isn't in the same directory as the HTML file.
Finally, assign the classes defined in your CSS file to the sections of your news posts. For example:
<BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
<H2 CLASS="newstitle">News Title</H2>
<P CLASS="newssubtitle">Date and time...</P>
<P CLASS="newsbody">The body of your news post here...</P>
[/code]
That should get you started.Post back if you have any trouble!
------------------
-Kevin Yank.
http://www.SitePoint.com/
Helping Small Business Grow Online!
-
May 16, 2000, 17:17 #3
- Join Date
- Aug 1999
- Location
- East Lansing, MI USA
- Posts
- 12,937
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Here is how you'd handle it with links, just put this in your .css file
A.menu:link {text-decoration: none; color: orange; font-size: 18pt; font-family: Pepita MT;}
A.menu:visited {text-decoration: none; color: orange;font-size: 18pt; font-family: Pepita MT;}
A.menu:active {text-decoration: none; color: orange;font-size: 18pt; font-family: Pepita MT;}
A.menu:hover {text-decoration: none; color: white; font-size: 18pt; font-family: Pepita MT;}
Then your link code would be:
<a class = "menu" href = ".....>
Basically with css you can define almost any tag with a style, and then add classes to that tag. And by linking to it instead of including it in the header (which you could do if you surround it by style tags) you can have all your pages link to it so that if you decide to change 1 thing you dont have to change it on every page (like SSI).
Chris
Bookmarks