Forums

quick-ref for WP Style Sheets syntax (3 posts)

  1. mugger
    Member
    Posted 1 year ago #

    In WP themes, the style.css show syntax not familiar to me. Please
    point me to a Quick-Ref so I can look up such lines as
    "font:bold italic 36px/42px "Times New Roman", Times, serif;"
    which differ from my experience in HTML-CSS2, example
    "h1 {font-weight:bold; font-style:normal; font-family:sans-serif;
    font-size:20pt;color:#aa6633;}"

    "http://www.w3.org/TR/xhtml1/#ref-css2" is not a quick-ref.

  2. sewmyheadon
    Member
    Posted 1 year ago #

    Mugger,

    The syntax within a WordPress style.css file should be exactly the same as you'd see in any other CSS file.

    There's a unique header with information about the theme, but the way you name elements and attributes is exactly the same.

  3. mercime
    Member
    Posted 1 year ago #

    @mugger:

    font: bold italic 36px/42px "Times New Roman", Times, serif;

    is a font declaration shortcut

    So that instead of listing the properties of the font separately and to decrease size of CSS files for large sites, you can use font shortcuts to list all in one line. You do have to list the font property declarations in order: font-style, font-variant, font-weight, line-height, font-size, font-family if you have declarations for all or skip any property where you do not have declarations at all.

    So in the font property shortcut above: the font-style is italic, no font-variant, font-weight is bold, font-size is 36px; line-height: 42px; font-family: "Times New Roman", Times, serif;

Topic Closed

This topic has been closed to new replies.

About this Topic