![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is there a shortcut way to define the default font family (and characteristics) to be applied to all styles? |
#3
| |||
| |||
|
|
Roedy Green <see_website (AT) mindprod (DOT) com.invalid> writes: Is there a shortcut way to define the default font family (and characteristics) to be applied to all styles? Just apply it to the top-level body rule: body { font: 1em serif } |
|
Elements nested in the body element will inherit its styles - that's the C (for Cascade) in CSS. |
#4
| |||
| |||
|
|
Scripsit Sherman Pendley: Roedy Green <see_website (AT) mindprod (DOT) com.invalid> writes: Is there a shortcut way to define the default font family (and characteristics) to be applied to all styles? Just apply it to the top-level body rule: body { font: 1em serif } The question presumably refers to browser default font family. What makes you think it is a serif font and that it is the font corresponding to the keyword serif? Hint: You have no grounds for that, |
|
Elements nested in the body element will inherit its styles - that's the C (for Cascade) in CSS. You don't understand the "C" in "CSS". Neither do most other authors, but this is a good reason to refrain from giving advice on CSS in public before you have a clue. |
|
The correct answer is that the "best" one can do is * { font-family: inherit !important; } but this a) isn't supported by IE b) is ineffective against style sheets that use the !important weapon too. |
#5
| |||
| |||
|
|
body { font: 1em serif } |
#6
| |||
| |||
|
|
On Sat, 02 Aug 2008 13:40:16 -0400, Sherman Pendley spamtrap (AT) dot-app (DOT) org> wrote, quoted or indirectly quoted someone who said : body { font: 1em serif } Thanks for your speedy response. I realise now that I do that already. Here is a related question, which is the one I should have asked in the first place. What if you have 3 basic font-family patterns on your website? e.g. for body text font-family: "Tiresias PCfont Z","Tiresias PCfont",TiresiasScreenfont,"Palatino Linotype","Bookman Old Style","Book Antiqua","Trebuchet MS","Lucida Sans","Lucida Sans Unicode",Verdana,serif; for title-like elements: font-family: Calibri,"Bitstream Vera Sans","Segoe UI",Arial,Helvetica,sans-serif; for monospaced elements: font-family: "Bitstream Vera Sans Mono","Lucida Console","Lucida Sans","Lucida Sans Unicode","Courier","Courier New","Bitstream Vera Sans","Segoe UI",Arial,monospace; Is there a way to specfy each pattern only once, then just indicate which pattern applies to any given style? |
|
I heard CSS was developing constants/variables, that might be useful to solve such a problem. How is that coming along? |
#7
| |||
| |||
|
|
No, unfortunately CSS has no means of defining macros, constants, or other such things. :-( |
#8
| |||
| |||
|
|
Scripsit Sherman Pendley: Roedy Green <see_website (AT) mindprod (DOT) com.invalid> writes: Is there a shortcut way to define the default font family (and characteristics) to be applied to all styles? Just apply it to the top-level body rule: body { font: 1em serif } The question presumably refers to browser default font family. What makes you think it is a serif font and that it is the font corresponding to the keyword serif? Hint: You have no grounds for that, |
#9
| |||
| |||
|
|
"Jukka K. Korpela" <jkorpela (AT) cs (DOT) tut.fi> writes: Scripsit Sherman Pendley: precisely what I've come to expect from you. *plonk* sherm-- |
#10
| |||
| |||
|
|
On Sat, 02 Aug 2008 17:01:04 -0400, Sherman Pendley spamtrap (AT) dot-app (DOT) org> wrote, quoted or indirectly quoted someone who said : No, unfortunately CSS has no means of defining macros, constants, or other such things. :-( hmm. If I used three different style sheets could I set up different body defaults for the three sheets in some way what would then provide the base for inheritance of the styles defined in that sheet? |
![]() |
| Thread Tools | |
| Display Modes | |
| |