Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

One css declaration for all css font properties

Tags:

css

What is the proper syntax for putting all css font properties into one value.

body {font: 12px, arial, red}

Something like that but with all the selectors and properties.

like image 263
thenengah Avatar asked Nov 18 '10 19:11

thenengah


2 Answers

body{
    font: bold italic 15px/20px arial,sans-serif;
    color: red;
}

http://www.w3schools.com/css/tryit.asp?filename=trycss_font

you can't include the color as part of the declaration. 15px/20px = font-size/line-height alt text

nice link, maegar!

like image 67
Sebastian Patane Masuelli Avatar answered Oct 19 '22 15:10

Sebastian Patane Masuelli


font: [ [ <'font-style'> || <'font-variant'> || <'font-weight'> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] | caption | icon | menu | message-box | small-caption | status-bar | inherit

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

like image 40
Harmen Avatar answered Oct 19 '22 13:10

Harmen