SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Oct 2001
    0 Post(s)
    0 Thread(s)

    What's the difference between BODY and P font sizes???

    Hi there,

    I'm pretty new to style sheets and was just wondering if anyone can explain to me the difference between specifying a font size in BODY and in P. In my external style sheet I have specified the same font size for both elements, thinking that if I forget to surround my text with <p> tags, then the text will be sized according BODY, ie the same size anyway. As it happens, any unformatted text is a size bigger. If I make the font size in BODY smaller, then it controls all font sizes on the page, making everything one size smaller.

    Is there a way to ensure that all my body text on the page is the same size, regardless of whether it is controlled by BODY or P? I am using ems as a unit of measurement, if this makes a difference.

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Nashvegas Baby!
    0 Post(s)
    0 Thread(s)
    Yes, it does make a difference. When using em, text inherits the size of the parent element. So, if you declare text to be .9em for the BODY tag then .9em for the P tag the text inside the P tag will be a size smaller.

    Your best bet would be to use pt. I personally have never experienced any problems with pt as a measurement.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts