Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 06-15-2008, 08:41 AM CSS Font Size 150%?
Spud In Disguise's Avatar
Super Spam Talker

Posts: 808
Location: UK... where else?
Trades: 0
Just brushing up on my CSS, and looking through the w3schools site I noticed that you can specifiy the font-size to be 150%. But 150% of what? Is that relative to the area the text is in?
__________________

Please login or register to view this content. Registration is FREE
- Fansite

Please login or register to view this content. Registration is FREE
- Blog
Spud In Disguise is offline
Reply With Quote
View Public Profile Visit Spud In Disguise's homepage!
 
 
Register now for full access!
Old 06-15-2008, 10:11 AM Re: CSS Font Size 150%?
Extreme Talker

Posts: 189
Trades: 0
The font-size value specifies the size of the font used to display the text. There are four types of values that can be used for font-size:
Value Example absolute-size { font-size: large; } relative-size { font-size: smaller; } length { font-size: 12pt; } percentage { font-size: 150%; } absolute-size values are words specifying definite font sizes. Possible values are: xx-small, x-small, small, medium, large, x-large and xx-large. Although the exact font size represented by, say, large, may vary from browser to browser, you can be sure that large will always be bigger than medium, for example.
relative-size values are relative to the inherited or default font size. Possible values are: larger and smaller. For example, if the inherited font size (from a parent style) is large, a relative-size of larger will set the font size to x-large.
length values are specified using the CSS length units such as em, px, cm and pt. For a full description of these, see the CSS Units reference.
percentage values are relative to the parent element's font size. For example, if the inherited font size is 12pt and a percentage value of 150% is specified, the resulting font size will be 18pt. See the CSS Units reference for details.








got from http://www.elated.com/articles/css-font-properties/
simster is offline
Reply With Quote
View Public Profile
 
Old 06-15-2008, 11:00 AM Re: CSS Font Size 150%?
Spud In Disguise's Avatar
Super Spam Talker

Posts: 808
Location: UK... where else?
Trades: 0
Ahh I see! Figured it'd be something like that. cheers!
__________________

Please login or register to view this content. Registration is FREE
- Fansite

Please login or register to view this content. Registration is FREE
- Blog
Spud In Disguise is offline
Reply With Quote
View Public Profile Visit Spud In Disguise's homepage!
 
Old 06-15-2008, 11:38 AM Re: CSS Font Size 150%?
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
The "default" font size in today's browsers is 16px. I always specify a base font size on the body in my css as 100.1% (to handle rounding errors). Then I specify my font sizes for all my elements from there.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 06-15-2008, 04:26 PM Re: CSS Font Size 150%?
Mooofasa's Avatar
Defies a Status

Posts: 1,611
Name: Michael (mik) Land
Location: England
Trades: 0
I specify it as 62.5% in the body selector in order to force browsers to use 1em as 10px; and using em over px/pt/name/% for font-sizes throughout.

Technically, I should also be using em for all measures, but it gets messy.
__________________

Please login or register to view this content. Registration is FREE
- Tumblog with thoughts, quotes, links, videos, images and my creations.

Please login or register to view this content. Registration is FREE
- The best free web browser.

Please login or register to view this content. Registration is FREE
- Firefox is now Firefail.

Last edited by Mooofasa; 06-15-2008 at 04:28 PM..
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Old 06-15-2008, 05:22 PM Re: CSS Font Size 150%?
Spud In Disguise's Avatar
Super Spam Talker

Posts: 808
Location: UK... where else?
Trades: 0
Quote:
Originally Posted by Mooofasa View Post
I specify it as 62.5% in the body selector in order to force browsers to use 1em as 10px; and using em over px/pt/name/% for font-sizes throughout.

Technically, I should also be using em for all measures, but it gets messy.
You're losing me there...
__________________

Please login or register to view this content. Registration is FREE
- Fansite

Please login or register to view this content. Registration is FREE
- Blog
Spud In Disguise is offline
Reply With Quote
View Public Profile Visit Spud In Disguise's homepage!
 
Old 06-15-2008, 07:59 PM Re: CSS Font Size 150%?
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
em goes as follows:
1.00 em is 100%
1.01 em is 101%
etc.
Also note: if I was to use the 'zoom' feature on my browser or set my default to something either larger or smaller that em and percent would work out well since it'd take the base of my browser as its base. So 150% would be 150% of my 12pt if I changed it to 12 point, etc. Points and pixels though would stay the same in most browsers (I think that IE8 may screw this up as it zooms pictures that have a width and height given as well as text). That is the good and the bad about pts and pxs, if I have trouble reading (I do) and you make it too small I can't change it without overriding it. It also keeps it from becoming too big and overflowing the screen or its part and screwing up layout.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 06-17-2008, 03:51 PM Re: CSS Font Size 150%?
Mooofasa's Avatar
Defies a Status

Posts: 1,611
Name: Michael (mik) Land
Location: England
Trades: 0
Quote:
Originally Posted by Spud In Disguise View Post
You're losing me there...
Code:
body{font-size: 62.5%;}
Will make browsers use 1em the equivalent of 10px.

Measurements in your CSS; Height, Width, Positioning, Padding, Border, Margin, and Font-Size should be done using EM to ensure it scales best throughout user desktop resolutions. However there's an issue when declaring the font-size and the other measures (i.e. width) in the same selector.
__________________

Please login or register to view this content. Registration is FREE
- Tumblog with thoughts, quotes, links, videos, images and my creations.

Please login or register to view this content. Registration is FREE
- The best free web browser.

Please login or register to view this content. Registration is FREE
- Firefox is now Firefail.
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Reply     « Reply to CSS Font Size 150%?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.62168 seconds with 12 queries