473,651 Members | 2,551 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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;*fon t: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 10816
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;*fon t: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;*fon t: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.Ho sking.name.INVA LID>
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;*fon t: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#pr opdef-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;*fon t: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;*fon t: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;*f ont:x-small;}
>What *I* want to know is, what does *font-size:small;*fon t: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
1858
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 prevent "Form Sprawl". Thanks -- Adam --
38
4579
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 used! But! when selecting the "Larger" or "Smaller" command from the menubar in IE, font sizes increases from normal (1em) to, say, 6em or so _in the first step_!!! In the next step it seems to be 20em or say. Choosing "Smaller" makes the text...
11
2039
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 xhtml and css. Now I made it, but I do not know, whether I "coded" a good css or not. If somebody has some minutes free, could you please post your opinion on my css, which you will find here:
86
7753
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: http://www.clagnut.com/blog/348/ I hope that's going to be a good discussion! Michael
60
4756
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 = 81.25
4
1902
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 post. Basically, this will work correctly if I remove all non-form related tags from the form =eg span, div, but I want to format the form all pretty like so??? Right now, it only collects 2 parts of the form fields =sites &
53
5239
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 non-support. I'm wondering if there's some way I could still get a primitive version of this functionality, because different fonts display at very different optical sizes for the same nominal sizes. For example, suppose I want type to display in...
3
2067
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 the ticker types the footer jumps up and down. Also the ticker does not work in firefox but does in IE7 (cant test in any others as dont have a computer with it on) . I am quite amateur to html and no nothing about javascript. I am aware there are...
2
4293
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 file. The portion that is not working is the star rating part <?php session_start(); include_once('includes/host_conf.php'); include_once('includes/db_connect.php'); include_once('includes/mysql.lib.php');...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8576
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7296
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6157
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4143
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1585
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.