Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-22-2012, 02:39 AM   #1
Mr. Alex
Senior Member
Registered: May 2010
Distribution: Debian
Posts: 1,238

Rep: Reputation: Disabled
Question CSS and default fonts

Hi folks.

If I don't specify font for say paragraphs in CSS, the default is used which in Windows most of the times == Times New Roman. Is not specifying font == specifying it as "serif"?


p {
  font-family: georgia;

p {
  font-family: georgia, serif;
Or specifying "serif" at the end makes a difference?
Old 11-22-2012, 02:57 AM   #2
Registered: Jan 2010
Location: Kurgan, Russia
Distribution: Slackware, Ubuntu
Posts: 350
Blog Entries: 3

Rep: Reputation: 47
The font-family property should hold several font names as a "fallback" system. If the browser does not support the first font, it tries the next font.

Start with the font you want, and end with a generic family, to let the browser pick a similar font in the generic family, if no other fonts are available.
1 members found this post helpful.
Old 11-22-2012, 03:02 PM   #3
Registered: Aug 2008
Location: Nova Scotia, Canada
Distribution: Slackware, OpenBSD, others periodically
Posts: 512

Rep: Reputation: 139Reputation: 139
Specifying no font used the browser default, not the system default. The browser will try and sue the font's named starting at the left and moving to the right as it doesn't find the font named. If it doesn't find any of the fonts named in the list it uses the browser default.

In your example 1, the browser would try and use georgia. If it didn't find georgia it would use the main browser default.

In your example 2, the browser would try and use georgia. If it didn't find georgia it would use whatever the browser default for serif fonts is set to.

Note the difference in the default behaviour.
1 members found this post helpful.
Old 11-23-2012, 02:46 AM   #4
Mr. Alex
Senior Member
Registered: May 2010
Distribution: Debian
Posts: 1,238

Original Poster
Rep: Reputation: Disabled
Thanks, I got it now.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS - Is there a way to put several lines of HTML into one line using CSS? Chronothread Programming 12 01-05-2011 06:06 AM
HTML/CSS/JS: Problem with <p> not having an absolute position with CSS. RHLinuxGUY Programming 7 03-03-2007 12:21 AM
How to choose default fonts? ChangWufei Debian 1 10-25-2005 08:34 PM
default fonts in QT3 (?) VertX Linux - Newbie 0 02-04-2005 10:02 AM
Firefox, fonts and userChrome.css dwmorton Linux - Software 2 11-05-2004 07:02 PM

All times are GMT -5. The time now is 09:09 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration