Page 1 of 1

CSS TEXT STYLE

Posted: Wed Jun 15, 2005 2:15 pm
by Parody
This is probably a really stupid question and it is probably going to make you laugh at my stupidity, but:

How do I make text on a page conform to a css style even if it does not have the style tags around it, so what I mean is, how do you set a default text style for a page?

:oops: :oops: :oops:

Posted: Wed Jun 15, 2005 2:17 pm
by timvw
you can't..... it depends on your visitors browser configuration... it's up to him to decide what the defaults are..

Posted: Wed Jun 15, 2005 2:22 pm
by Parody
You probably understand but I will explain what I mean more,

I have a text style in a css file, how do I set it so that all the text written on that page conforms to that style, instead of having to put tags around all my html pieces in a php document.

Posted: Wed Jun 15, 2005 2:25 pm
by timvw
If i understand well.... in your css

Code: Select all

body {
  // set text style thingies here...
}

Posted: Wed Jun 15, 2005 2:26 pm
by Parody
I've got it now, I just used the tags and put it around the whole document, so whatever is printed is included in the style :)

Posted: Wed Jun 15, 2005 4:46 pm
by Chris Corbyn
Basic CSS like timvw mentioned

Code: Select all

/*
 Classes
 Behaviour: Appies to anything with class=&quote;classname&quote; as an attribute
 */

.classname { attributes:values; }

/*
 By ID tags
 Behaviour: Applies to anything with id=&quote;IDTagname&quote; as an attribute,
            -- classes dominate anything that clashes.
 */

#IDTagname { attributes:values; }

/*
 By XHTML Element
 Behaviour: Applies to anything that is inside this <elementname></elementname>
            -- IDTags dominate anything that clashes.
 */

elementname { attributes: values; }

/*
 NOTE: You can combine these together however suits too.....
 */
Check out http://www.w3schools.com/css/ for tutorials and reference ;)