Changing Font Sizes, Colors, Etc. in Style Sheets (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets and Accessibility



Message


Edge -> Changing Font Sizes, Colors, Etc. in Style Sheets (6/14/2006 17:20:23)

Please forgive me if this has been asked and answered before, but I have not been able to find an answer using various search keywords.

I am very new to CSS, so I set up my external style sheet using abbeyvet's tuturial (very nice by the way [:)]), and decided to add different types of fonts.

Changing font size and color etc. for the normal font "p" is straightforward. Any change to size and color works in both IE and FF.

But I tried adding a different fonts and it works in IE, but not FF.

Example:
P {font-family: Verdana, Arial; font-weight: normal; font-size: 10pt; color: white;}

P.2 {font-family: Verdana, Arial; font-weight: normal; font-size: 12pt; color: red;}

If I specify "P.2"; it appears fine in IE, but in FF it will use the default "P".

http://www.bennygordon.us/benny.htm

How should I create different fonts like the headers do (H1, H2, H3, etc.)? Changing these works in both IE and FF as intended.

Any help is appreciated. Thanks, Ed






Tailslide -> RE: Changing Font Sizes, Colors, Etc. in Style Sheets (6/14/2006 17:28:55)

Hi Ed

Off-hand (dragging something up from the back of my memory so may not be completely right) I think that you can't start class and id names with a number (can't quite remember if a single letter/digit is ok). Try changing the name of the class and it should work.

Not sure what you're after regarding the headings - did you want to style those too? If so then it's just

h1 {whatever rules you want;}


or even

h1, h2 {color:red;}






Edge -> RE: Changing Font Sizes, Colors, Etc. in Style Sheets (6/14/2006 17:56:34)

quote:

I think that you can't start class and id names with a number (can't quite remember if a single letter/digit is ok). Try changing the name of the class and it should work.


Perfect! I changed the "P.2" to "P.F2" and it works for both IE and FF.

Regarding the headings, yes I wanted to change the font size, color, etc. But I did that and it worked from the beginning. I was only having problems setting up different types of fonts.

Thanks for your prompt response and help.

Ed




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875