One css declaration for all css font properties

前端 未结 3 1439
孤独总比滥情好
孤独总比滥情好 2021-02-04 09:40

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 th

相关标签:
3条回答
  • 2021-02-04 09:59
    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!

    0 讨论(0)
  • 2021-02-04 10:06
    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

    0 讨论(0)
  • 2021-02-04 10:12

    http://www.w3.org/TR/CSS2/fonts.html

    For a tutorial:

    http://www.w3schools.com/css/pr_font_font.asp

    0 讨论(0)
提交回复
热议问题