• 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

Style div inner for different pages

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 › Style div inner for different pages

This topic is: not resolved

Tagged: inner

  • This topic has 4 replies, 4 voices, and was last updated 12 years, 11 months ago by cavemedia.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • December 27, 2012 at 4:45 pm #7767
    treestone
    Member

    Hi,

    How can I use my general theme but change the css class per page.

    This is the css I have

    #inner {
    background: url(images/bg-top.jpg) repeat-x top;
    padding: 40px 0 20px;
    overflow: hidden;

     

    but on some pages I would like it to be

    #inner {
    background: url(images/bg-top.jpg) repeat-x top;
    overflow: hidden;
    (remove the padding)

    Thanks

    December 29, 2012 at 12:16 pm #8184
    Jared Williams
    Member

    On you individual pages look under "Layout Settings". There you can define a Body Class.

    So, if your page was an About page that you wanted styled differently, you could add "about" (no quotes) in the Body Class field, then style it accordingly using:

    .about #inner {
            background: url(images/bg-top.jpg) repeat-x top;
            overflow: hidden;
            padding: 0;
    }
    

    Website | Twitter | Instagram | Google +

    December 29, 2012 at 2:50 pm #8206
    Chris Cree
    Participant

    Or you can use the same custom body class for all the pages to keep things simpler for you. Something like a body class of nopadding might be less confusing instead of the page title.

    Add the style like Jared said with the "generic" class instead. As long as it is below your existing #inner definition in your stylesheet you only need to add the bit(s) you want to change. In this case it's the padding. So you can simplify it to this:

    .nopadding #inner {
            padding: 0;
    }
    January 8, 2013 at 1:44 am #10302
    cavemedia
    Member

    This is just what I was looking for... except that I'd like to set a different tag for the home page (Enterprise Child Theme). The home page is not listed.

    🙂

    January 8, 2013 at 10:07 am #10370
    cavemedia
    Member

    Answer to my own question above...

    I looked at the body tag on the home page and noticed it included a class called "home", so I simply created a tag called .home #inner with the new style defined.

    NOTE: You Must define all style elements on the new style in order to cancel out the first style:

    For example, if your inner style includes a background...
    #inner{
    background: url(/wp-content/uploads/bg-inner.png);
    border: 1px solid #fefadb;
    }

    The background will NOT be removed unless you define the background as none
    .home #inner {
    background: none;
    border: none;
    }

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 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