473,396 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

What does "font:13px/1.231" syntax mean?

I'm a CSS newbie, but I was browsing through the css files in the YUI
library, and I noticed the following line:

body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-
size:small;*font:x-small;}

I understand everything but the "/1.231". Is that something like a
multiplier on the EM size? I can't find an example of that in the CSS
spec.
Jun 27 '08 #1
4 10799
david.karr wrote:
I'm a CSS newbie, but I was browsing through the css files in the YUI
library, and I noticed the following line:

body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-
size:small;*font:x-small;}

I understand everything but the "/1.231". Is that something like a
multiplier on the EM size? I can't find an example of that in the CSS
spec.

It's line-height, cleverly hidden at
http://www.w3.org/TR/CSS21/visudet.h...ef-line-height , which one
can find (if one thinks to look there) by looking at
http://www.w3.org/TR/CSS21/fonts.html#font-shorthand .

Yes, without units it's a multiplier of the element's font size (viz.
http://www.w3.org/TR/CSS21/visudet.html#x25).

If you understand everything else, you understand they're suggesting a
somewhat small font-size, fixed in px so that e.g. IE6 users can't
increase the text to make it more legible.

What *I* want to know is, what does *font-size:small;*font:x-small; mean?

--
John
Read about the UIP: http://improve-usenet.org/
Jun 27 '08 #2
On May 1, 10:30 am, John Hosking <J...@DELETE.Hosking.name.INVALID>
wrote:
david.karr wrote:
I'm a CSS newbie, but I was browsing through the css files in the YUI
library, and I noticed the following line:
body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-
size:small;*font:x-small;}
I understand everything but the "/1.231". Is that something like a
multiplier on the EM size? I can't find an example of that in the CSS
spec.

It's line-height, cleverly hidden athttp://www.w3.org/TR/CSS21/visudet.html#propdef-line-height, which one
can find (if one thinks to look there) by looking athttp://www.w3.org/TR/CSS21/fonts.html#font-shorthand.

Yes, without units it's a multiplier of the element's font size (viz.http://www.w3.org/TR/CSS21/visudet.html#x25).
Thanks.
If you understand everything else, you understand they're suggesting a
somewhat small font-size, fixed in px so that e.g. IE6 users can't
increase the text to make it more legible.

What *I* want to know is, what does *font-size:small;*font:x-small; mean?
From the "Learn YAHOO" book:

"The final two rules in the <bodyselector, *font-size:small and
*font:x-small, are used to set the font-size in IE (which makes better
use of the CSS keywords for font-size than it does of percentages) and
addresses text-rendering peculiarities in older versions of IE, which
can incorrectly interpret the font-size keywords specified by the CSS1
standard thus making all of your fonts appear bigger than they should."
Jun 27 '08 #3
On 2008/05/01 10:10 (GMT-0700) david.karr apparently typed:
I'm a CSS newbie, but I was browsing through the css files in the YUI
library, and I noticed the following line:
body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-
size:small;*font:x-small;}
I understand everything but the "/1.231". Is that something like a
multiplier on the EM size? I can't find an example of that in the CSS
spec.
It means Yahoo recommends web authors couple tiny text with line-height (leading) equal to 123.1% of the text size. 13px is a good recommendation to avoid (as is font-size:small and font-size: x-small), though the /# CSS
syntax is a perfectly fine method of unifying native line-heights that might otherwise be undesirably large or small. http://www.w3.org/TR/CSS21/fonts.html#font-shorthand
--
". . . . in everything, do to others what you would
have them do to you . . . ." Matthew 7:12 NIV

Team OS/2 ** Reg. Linux User #211409

Felix Miata *** http://fm.no-ip.com/
Jun 27 '08 #4
david.karr wrote:
On May 1, 10:30 am, John Hosking wrote:
>david.karr wrote:
>>I'm a CSS newbie, but I was browsing through the css files in the YUI
library, and I noticed the following line:
body {font:13px/1.231 arial,helvetica,clean,sans-serif;*font-
size:small;*font:x-small;}
>What *I* want to know is, what does *font-size:small;*font:x-small; mean?

From the "Learn YAHOO" book:

"The final two rules in the <bodyselector, *font-size:small and
*font:x-small, are used to set the font-size in IE (which makes better
use of the CSS keywords for font-size than it does of percentages) and
addresses text-rendering peculiarities in older versions of IE, which
can incorrectly interpret the font-size keywords specified by the CSS1
standard thus making all of your fonts appear bigger than they should."
Okay, I can appreciate the IE font-size keyword problem (although I've
never had to wrestle with it myself).

What I'm more puzzled by is the "*font-family" notation. I've never seen
it before, and I can't get it to validate to any CSS level. Is there
some interpreter in the Yahoo YUI thingy that does something useful with
these weird declaration formats (and then cleans it out of the style
sheet presented to the browser)? Does the asterisk mean something in
particular?
--
John
Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Adam Smith | last post by:
Hello, Designing a form, with field layout in a table to maintain consistency in appearance. Table field heights set to 13 pxs. Textfield default height is 24 pxs. how can I reduce it so as to...
38
by: Kai Jaeger | last post by:
I am playing with setting font sizes in CSS using em as unit of measurement. All seems to be fine. Even Netscape Navigator shows the characters very similar to IE, what is not the kind if px is...
11
by: Michael Kalina | last post by:
Hi everybody! I have three questions, maybe somebody could help me with it. 1. "If you have a minute or two..." I usually do not do a lot with CSS, but I decided to have my site run on pure...
86
by: Michael Kalina | last post by:
Because when I asked for comments on my site-design (Remember? My site, your opinion!) some of you told me never to change anything on font-sizes! What do you guys think of that:...
60
by: deko | last post by:
As I understand it, most browser manufacturers have agreed on 16px for their default font size. So, this should be an accurate conversion for percentages: px % 16 = 100 14 = 87.5 13 =...
4
by: _Raven | last post by:
Okay, I am playing with submitting forms with Ajax. I am trying to adapt this script to my forms: http://www.captain.at/howto-ajax-form-post-get.php I have included my code at the bottom of this...
53
by: Jonas Smithson | last post by:
In his book "CSS: The Definitive Guide" 2nd edition (pgs. 116-117), Eric Meyer has an interesting discussion about "font-size-adjust" that was evidently dropped in CSS 2.1 due to browser...
3
by: rassklass | last post by:
HI all, I have designed a site found at www.pickupnewspapers.co.uk/nottinghamshire/index.html but I cant get the footer to sit stil on the page. It is because of the javascript ticker, everytime...
2
by: bips2008 | last post by:
The code seems to work fine in other browser but in IE it throws this error. This is very urgent for me and any help would be greatly appreciated For your convienence i have posted the code for the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.