Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

And even more shorthands

No description of shorthands would be complete without mentioning font shorthands. Check out all the properties we need for fonts: font-family, font-style, font-weight, font-size, font-variant, and don’t forget line-height. Well, there’s a shorthand that wraps all these into one. Here’s how it works:

image with no caption
image with no caption

So let’s give this a try. Here are the font properties for the lounge body:

image with no caption

Now let’s map those to the shorthand:

And now let’s write the shorthand:

image with no caption

There are no Dumb Questions

Q:

Q: Should I always use shorthand?

A:

A: Not necessarily. Some people find the long form more readable. Shorthands do have the advantage of reducing the size of your CSS files, and certainly they are more quickly entered because they require less typing. However, when there is a problem, they are a little more difficult to “debug” if you have incorrect values or the wrong order. So, you should use whichever form is more comfortable because they are both perfectly valid.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint