Dear, I am interested in how shorthand properties work. Actually, I didn't know that font: 32px arial firefox accept, but font: 32px ignore. I have thought that it doesn't matter which properties (font-weight, font-size, font-family, etc...) you include and that it only matters how you order them. Is there some document that explain how all shorthand properties should be used? Is there some general rule about shorthand properties? Huh, it took me almost an hour to figure out that my css file has that kind of ignore Thank you in advance. the best regards,
While it has nothing to do with the specifications, if I'm changing my font-size I automatically use the shorthand version, but I always at least state weight size/line-height "desired font", "fallback font", family The reason for this is to make certain that if I change something upstream of it for style or weight I don't have to worry about it, you cant trust the default line-height behavior across browsers since they can give you wildly different values (gecko in particular is a complete ****tard about line-height), and of course you should ALWAYS have a fallback family. so if I'm going to change font size, I would use: font:normal 32px/36px arial,helvetcia,sans-serif; Just to make 100% certain I get what I want. It's not like it's enough 'extra code' to worry about anyways since font-size:32px; line-height:36px; is almost as many characters... and again, I NEVER declare a font-size without explicitly setting a line height. By the specification you should be able to omit or include whatever properties you want - but as we all know ALL of the browser makers tend to go their own directions and do whatever the hell they want when anything is left as "should" that doesn't mean they'll implement it that way.
Is order of properties important? To be honest, I can't find that part in http://www.w3.org/TR/CSS2/fonts.html#propdef-font, so you give me a link where it is described? Thanks.
the order isn't important, just some have certain minimum properties necessary. People get so used to easy ones like "background" (which I never use without at least two properties) which let you just mention one thing, they get confused with ones like font or border which demand certain properties. The order of the fonts in the font-family declaration matter, and yes that's in the specs. The 13px/16px order is important as the first is always the font size while the second is always the line-height (if you write it that way). There is no necessary order for the things like font-variant, font-style, or font-weight.
Please, could you provide a link? Thanks. I have only found at http://www.w3.org/TR/CSS2/about.html#x0 that properties are first reset. I can't find that order is not important and that it is not important which of them are omitted. Also, I would like to find what are "minimum properties necessary" for each shorthand property.
maybe these links will help you. I don't think you are going to find it mapped out from an official source, doesn't mean you have to stop trying though. Lots more google for css shorthand properties , maybe you can find an answer. http://www.dustindiaz.com/css-shorthand/ http://www.domedia.org/oveklykken/css-shorthands.php
Now I have found that font-size and font-family must be set in that order, but other properties could be omitted. Thanks a lot.