4 replies [Last post]
nanacss
nanacss's picture
Offline
Enthusiast
Last seen: 7 years 40 weeks ago
Timezone: GMT+8
Joined: 2007-07-27
Posts: 107
Points: 22

Hi all, recently i want to know more bout the elastic layout things then i consider the text size too.

what is this means:

body { font-size: 76%; }

or

body { font-size: 100%; } if i put above code in my body, and then i use em, and i know if i put p for 0.75em , my p is 12px (0.75x16)

what is body font-size does here?

thank you very much for replying.
really appreciate it.
thanks

真诚清静平等真觉慈悲,看破放下自在随缘念佛。
name: WEN YU
my blog: http://webwhalenews.com
my collection: http://gtoystage.com

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 6 years 36 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

There is always a default

There is always a default font-size applied to body, this on windows boxes tends to be 16px on Macs 13px.

Therefore stating 100% font size on the body is simply saying use the default size and would equate to 16px lowering the percentage body size is also simply reducing the default size.

Using EMs thereafter is a relative measure computed against it's parent so p{font-size:1em} would mean 100% of the parent if that's body and it's set to 76% you would have in the region of 12px font-size.

There are many good tutorials on font-sizing around the web and also this question has been covered in greater detail many times on the forum so have a search for previous threads for more info.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

nanacss
nanacss's picture
Offline
Enthusiast
Last seen: 7 years 40 weeks ago
Timezone: GMT+8
Joined: 2007-07-27
Posts: 107
Points: 22

Hi Hugo, thank you very much

Hi Hugo, thank you very much for your reply.

yes, i found this : http://www.alistapart.com/articles/howtosizetextincss

but i still not very understand.

i will read more about it.

and thanks for your explaination, i really appreciate it.
Smile

真诚清静平等真觉慈悲,看破放下自在随缘念佛。
name: WEN YU
my blog: http://webwhalenews.com
my collection: http://gtoystage.com

Jflow
Offline
newbie
Last seen: 13 years 37 weeks ago
Joined: 2008-01-06
Posts: 1
Points: 0

Here's a good place where

Here's a good place where you can practice the above discussed techniques.

http://www.w3schools.com/css/tryit.asp?filename=trycss_font-size

Good Luck.

nanacss
nanacss's picture
Offline
Enthusiast
Last seen: 7 years 40 weeks ago
Timezone: GMT+8
Joined: 2007-07-27
Posts: 107
Points: 22

wow! hahaha!!! thank you

wow! hahaha!!!

thank you very much!!!

i was playing with 100%, 76% etc.

is very interesting, thank you! Smile

真诚清静平等真觉慈悲,看破放下自在随缘念佛。
name: WEN YU
my blog: http://webwhalenews.com
my collection: http://gtoystage.com