CSS TEXT STYLE

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
Parody
Forum Contributor
Posts: 252
Joined: Fri May 06, 2005 7:06 pm
Location: Great Britain

CSS TEXT STYLE

Post 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:
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

you can't..... it depends on your visitors browser configuration... it's up to him to decide what the defaults are..
Parody
Forum Contributor
Posts: 252
Joined: Fri May 06, 2005 7:06 pm
Location: Great Britain

Post 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.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

If i understand well.... in your css

Code: Select all

body {
  // set text style thingies here...
}
Parody
Forum Contributor
Posts: 252
Joined: Fri May 06, 2005 7:06 pm
Location: Great Britain

Post 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 :)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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 ;)
Post Reply