CSS Text Attributes

He has: 173 posts

Joined: Nov 2002

Just wondering how one is supposed to write CSS to tell the actual body text to be a certain way. I've been using this stuff for quite a while but, for some reason, the text part doesn't seem to be working right unless I use something like the following before the actual text:

p {font-family: Helvetica; color: #000033; font-size: 8px;}

Would one of the following be the right way to do this?

(1). a {font-family: Helvetica; color: #000033; font-size: 8px;}

(2). a: {font-family: Helvetica; color: #000033; font-size: 8px;}

OR, do I have to go in the actual body tag and do something like what's shown below?

This is the format I want to use, if possible:

I checked back through several of the tutorials and it seems they jump right into the a:link, a:active, etc. and don't really cover the main body text color . . . unless I missed it somewhere. Confused

Thanks in advance.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

body {color:red; font-size:normal}

p {} is a selector for all tags . Similarly, body {} is a selector for all tags (although there should be only one). Smiling

They have: 461 posts

Joined: Jul 2003

if you're doing universal tags, you do them in the head, and a general rule of thumb is

<script langueas="text/css">
<!-- comment it  out for non-css browsers

/* css stuff */
-->
&lt;/script&gt;
'

you can also do it so it does nesting... ie:
ol li { attributes}
ol ol li {different attributes}

and it will differentiate

POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.

He has: 173 posts

Joined: Nov 2002

Okay, that does make sense. Thanks Abhishek! Smiling

To m3rajk: Of course you're right, but I just got a bit lazy (or, in a hurry) on my post and left out all that other stuff. Thanks for making sure I knew about it, though. Smiling

They have: 461 posts

Joined: Jul 2003

np. always better to err on the side of caution when someone's new to tsomething.. and sometimes when they aren't as well. it's normally the small things people overloook later.

POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.