• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Where to put code for CSS Sprites

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Where to put code for CSS Sprites

This topic is: not resolved

Tagged: child themes, css, sprites

  • This topic has 2 replies, 2 voices, and was last updated 10 years, 8 months ago by jarmijo.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • September 8, 2014 at 1:29 pm #123464
    jarmijo
    Member

    So I get the concept around CSS sprites. I've combined all the images into one image and calculated the size of each image etc. I used this post as a reference

    http://www.studiopress.com/design/css-sprites.htm

    I don't know where to put the code. Here is the sample code from the article:

    #social-icons .facebook {
        background: url(images/sprites.png) -292px -301px no-repeat;
        display: block;
        height: 16px;
        width: 16px;
    }
     
    #social-icons .facebook:hover {
        background-position-y: -317px;
    }
    

    Do I put the above code in the Functions.PHP file of the child theme?

    Using the above sample code - would I replace .facebook and .facebook:hover with .twitter and .twitter:hover?

    Would I still use the #social-icons name before .twitter?

    How do I reference the sprite class in the page I want the images to appear on?

    I know this is a lot of questions. Any help is greatly appreciated.

    September 9, 2014 at 5:58 am #123548
    emasai
    Participant

    This is css code, so you put the code in the style.css file. You might want to read up more on css sprites, this article for example
    http://www.w3schools.com/css/css_image_sprites.asp


    Need Website Customization or a Responsive CSS fix? Contact Me
    Lynne emasai.com

    September 9, 2014 at 5:00 pm #123660
    jarmijo
    Member

    Lynne,
    Thanks for taking the time to respond. Turns out I was doing it correctly all along but the code was conflicting with some other code. That's why I couldn't figure out what I was doing incorrectly. Two days to figure it out.

    Thanks again for your help.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble