Changing All Text

Discussion in 'CSS' started by mmelen, Feb 21, 2007.

  1. #1
    What is the CSS function for all the text on the site?

    For example, "A:link" will change all the links on the site. What's the equivalent to text?
     
    mmelen, Feb 21, 2007 IP
  2. siu00as

    siu00as Peon

    Messages:
    87
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can change all the text using the body selector for example:
    
    body{
         color:#666666;
         font-size:1.2em;
    }
    Code (markup):
     
    siu00as, Feb 21, 2007 IP
  3. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    #3
    I would rather use something like this to avoid text formatting inconsistences in some browsers..
    body, div, p, td, span, a, form, input, textarea {
         color:#666666;
         font-size:1.2em;
    }
    Code (markup):
     
    Clive, Feb 21, 2007 IP
  4. Josh Inno

    Josh Inno Guest

    Messages:
    1,623
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Clive:

    And that doesn't cause text inside of a p tag inside of a div tag to appear larger than text inside of a p tag that is not within a div tag?
     
    Josh Inno, Feb 22, 2007 IP
  5. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    #5
    Oops, I did not pay attention to the way font size is defined. I quoted the code sample to highlight the body, div, p, td, span, a, form, input, textarea { ... } part. Set fixed size instead, and it should work.
     
    Clive, Feb 22, 2007 IP
  6. Josh Inno

    Josh Inno Guest

    Messages:
    1,623
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Ah. Alright then. I honestly wasn't sure. Thanks.
     
    Josh Inno, Feb 22, 2007 IP