WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Unfamiliar with a line of CSS code (7 posts)

  1. Garrett Cobarr
    Member
    Posted 3 years ago #

    I have almost figured out most of the CSS in my custom.css file that overrides the style.css file. But one is stumping me, its layout and vocabulary. Its in one line.

    .post .title, .page .title, .post .title a:link, .post .title a:visited, .page .title a:link, .page .title a:visited {font-family: "myriad-pro-1","myriad-pro-2",sans-serif;}

    It is towards the top of the file. How does this fit into the structure? Its purpose?

  2. Josh
    Member
    Posted 3 years ago #

    The post and page titles are set in myriad pro typeface, with a fallback to sans serif. The -1, -2 in the font stack is for typekit.

  3. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    it means: use the font-family for

    -post title,
    -page title,
    -post title link, also in the :visited state,
    -page title link, also in the :visited state

    http://www.w3schools.com/CSS/pr_font_font-family.asp
    general
    http://www.w3schools.com/CSS/css_font.asp

  4. Garrett Cobarr
    Member
    Posted 3 years ago #

    Thanks guys, my question was why is it written in this fashion and in the position at top of doc? All of these are styled below this line.

    Is this acting like an 'umbrella' style to insure nothing is missed below? And, if all the elements are styled below, is this redundant?

    Just trying to understand the structure of CSS better...

  5. djsounds02
    Member
    Posted 3 years ago #

    You say it is a custom.css there might be no reason for it being where it is other than a last minute adjustment on the creators behalf.

  6. Josh
    Member
    Posted 3 years ago #

    When you can group selectors, as in the example above, it's more efficient. Otherwise you'd have to repeat the font-family style over and over again to get the same effect.

  7. Garrett Cobarr
    Member
    Posted 3 years ago #

    Thanks Josh, I suspected that might be going on but was not sure.

Topic Closed

This topic has been closed to new replies.

About this Topic