|
Convenient web based access to our favorite web design Usenet groups
|
 |
This is Interesting: Free Magazines for Graphics designers and webmasters
| Author |
| Thread |
 |
|
|
|
|
|
 |
 |
|
|
 |
|
|
 |
 |
Re: Question: Shorthand" CSS code? |
 |
|
 |
|
|
|
  08-23-04 - 12:17 AM
|
On Sun, 22 Aug 2004 11:40:22 -0500, Dave <dave@yahoo.com> wrote:
> Occasionally, I've seen people write CSS code in shorthand for specifying
> font styles. I don't exactly remember how it goes, but sometimes I see
> things like this:
>
> SPAN {font: arial, helvetica 11 bold}...
>
> I think this is a great idea, and I'd like to do some fine tuning of my
> own
> code. Does anybody know where I can get an explanation of how this coding
> strategy works? What about for multiple font names?
>
> Any information is appreciated. Thanks!
>
See http://www.w3.org/TR/CSS2/propidx.html for all CSS2 properties. You'll
find a number of shorthand possibilities, including font.
However, your above rule is flawed. Font-family comes last, and 11 has no
unit. It's not required, but advisable, to end your font family with a
generic.
span {font: bold 110% Arial, Helvetica, sans-serif}
Is it better? If you use the font shorthand all 5 the font-weight,
font-style, font-size and font-family are reset to their normal values
before the changes you make are set. So if you don't state all of these
values, you might expect a font-weight: bold to be inherited but it won't
be.
Like all shorthand styles, there are times it's the right tool for the
job, and times it's not.
|
|
|
| [
Post Follow-Up to this message ]
|
|
|
|
|
 |
 |
Re: Question: Shorthand" CSS code? |
 |
|
 |
|
|
|
  08-23-04 - 12:17 AM
|
Wouldn't the Arial, Helvetica, Sans-Serif be surrounded in quotes?
--
============================
- Dave
http://members.cox.net/grundage/
"Neal" <neal413@yahoo.com> wrote in message
news:opsc5awty06v6656@news.individual.net...
> On Sun, 22 Aug 2004 11:40:22 -0500, Dave <dave@yahoo.com> wrote:
>
specifying
coding
>
>
> See http://www.w3.org/TR/CSS2/propidx.html for all CSS2 properties. You'll
> find a number of shorthand possibilities, including font.
>
> However, your above rule is flawed. Font-family comes last, and 11 has no
> unit. It's not required, but advisable, to end your font family with a
> generic.
>
> span {font: bold 110% Arial, Helvetica, sans-serif}
>
> Is it better? If you use the font shorthand all 5 the font-weight,
> font-style, font-size and font-family are reset to their normal values
> before the changes you make are set. So if you don't state all of these
> values, you might expect a font-weight: bold to be inherited but it won't
> be.
>
> Like all shorthand styles, there are times it's the right tool for the
> job, and times it's not.
|
|
|
| [
Post Follow-Up to this message ]
|
|
|
|
|
 |
|
|
 |
 |
Re: Question: Shorthand" CSS code? |
 |
|
 |
|
|
|
 |
| All times are GMT. The time now is 03:26 PM. |
 |
|
|
|
|
|  |
|