Web Design Web Design Forum
Registration is free! Here you can view your subscribed threads, work with private messages and edit your profile and preferences Calendar Find other members Frequently Asked Questions Search
Home Web Design

Convenient web based access to our favorite web design Usenet groups

web design reviews

This is Interesting: Free Magazines for Graphics designers and webmasters  





  Last Thread  Next Thread
Author
Thread Post New Thread   

Question: Shorthand" CSS code?
 

Dave




quote this post edit post

IP Loged report this post

Old Post  08-23-04 - 12:17 AM  
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!

--
============================
- Dave
http://members.cox.net/grundage/




Post Follow-Up to this message ]
Re: Question: Shorthand" CSS code?
 

David Dorward




quote this post edit post

IP Loged report this post

Old Post  08-23-04 - 12:17 AM  
Dave wrote:

> Occasionally, I've seen people write CSS code in shorthand for specifying
> font styles. I don't exactly remember how it goes

So rtfm: http://www.w3.org/TR/CSS2/fonts.html#font-shorthand

> SPAN    {font: arial, helvetica 11 bold}...

11 what? A unit is required, but no unit that could go there could be a good
choice.

> I think this is a great idea

It isn't that great - it means you have to remember things such as which
properties must be specified when you use the shorthand. It makes it easier
to introduce errors and harder to maintain.


--
David Dorward       <http://blog.dorward.me.uk/>   <http://dorward.me.uk/>
Home is where the ~/.bashrc is


Post Follow-Up to this message ]
Re: Question: Shorthand" CSS code?
 

Neal




quote this post edit post

IP Loged report this post

Old Post  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?
 

Dave




quote this post edit post

IP Loged report this post

Old Post  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?
 

Jukka K. Korpela




quote this post edit post

IP Loged report this post

Old Post  08-23-04 - 12:17 AM  
"Dave" <dave@yahoo.com> wrote:

> Wouldn't the Arial, Helvetica, Sans-Serif be surrounded in quotes?

Maybe in your code. But your posting style (upside-down fullquoting, and
a few other signals) suggests that you are not looking for constructive
comments. Anyway, here's one: quoting Sans-Serif would make sense only if
there were a font with the proper name "Sans-Serif". Of course, anyone
and his brother could design such a font (though hopefully couldn't
trademark it), but they haven't, so far.

--
Yucca, http://www.cs.tut.fi/~jkorpela/


Post Follow-Up to this message ]
Re: Question: Shorthand" CSS code?
 

David Dorward




quote this post edit post

IP Loged report this post

Old Post  08-23-04 - 12:17 AM  
Dave wrote:

Please direct your attention to http://www.allmyfaqs.com/faq.pl?How_to_post

> Wouldn't the Arial, Helvetica, Sans-Serif be surrounded in quotes?

No... as it says under font-family in the spec (which I referenced in my
last contribution to this thread).

--
David Dorward       <http://blog.dorward.me.uk/>   <http://dorward.me.uk/>
Home is where the ~/.bashrc is


Post Follow-Up to this message ]
Re: Question: Shorthand" CSS code?
 

Neal




quote this post edit post

IP Loged report this post

Old Post  08-23-04 - 12:17 AM  
On Sun, 22 Aug 2004 13:39:06 -0500, Dave <dave@yahoo.com> wrote:

> Wouldn't the Arial, Helvetica, Sans-Serif be surrounded in quotes?
>


Please don't reply on top, and especially don't put quoted material in the
signature (under the --).

Quotes are only used to surround font names with spaces like "Times New
Roman" or "Arial BT". And by the way, I don't know for sure whether
Sans-Serif is incorrect, but the "proper" form is sans-serif. Remember,
it's not a name of a font. It's a generic font that cues the UA to use
whatever is the generic sans-serif font to render the text. For most UAs
this is Arial or Helvetica anyway, but it could be anything.


Post Follow-Up to this message ]
Re: Question: Shorthand" CSS code?
 

Harlan Messinger




quote this post edit post

IP Loged report this post

Old Post  08-24-04 - 12:19 AM  
"Dave" <dave@yahoo.com> wrote:

>Wouldn't the Arial, Helvetica, Sans-Serif be surrounded in quotes?

Only if  "Arial, Helvetica, Sans-Serif" is the name of a single font
family.

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ๔ter le premier point de mon adresse de courriel.


Post Follow-Up to this message ]
Re: Question: Shorthand" CSS code?
 

Neal




quote this post edit post

IP Loged report this post

Old Post  08-26-04 - 05:28 PM  
On Sun, 22 Aug 2004 13:39:06 -0500, Dave <dave@yahoo.com> wrote:

> Wouldn't the Arial, Helvetica, Sans-Serif be surrounded in quotes?
>


Please don't reply on top, and especially don't put quoted material in the
signature (under the --).

Quotes are only used to surround font names with spaces like "Times New
Roman" or "Arial BT". And by the way, I don't know for sure whether
Sans-Serif is incorrect, but the "proper" form is sans-serif. Remember,
it's not a name of a font. It's a generic font that cues the UA to use
whatever is the generic sans-serif font to render the text. For most UAs
this is Arial or Helvetica anyway, but it could be anything.


Post Follow-Up to this message ]
Sponsored Links
 





All times are GMT. The time now is 03:26 PM. Post New Thread   
  Previous Last Thread   Next Thread next
Stylesheets archive | Show Printable Version | Email this Page | Subscribe to this Thread

Popular forums

Adobe Photoshop forum Macromedia Flash Web Site Design
Dreamweaver FrontPage forum
JavaScript Forum XML forum
Style Sheets VRML
Forum Jump:
Rate This Thread:

 

XML RSS Feed web design latest articles Syndicate our forum via XML or simple JavaScript

Web Design archive  Database administration help  


Top Home  -  Register  -  Control Panel   -  Memberlist  -  Calendar  -  Faq  -  Search Top