[Resolved] Adding custom class to entry-content?

Home Forums Support [Resolved] Adding custom class to entry-content?

Home Forums Support Adding custom class to entry-content?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #180001
    Wayne

    Hello! How can I add add a custom class to entry-content? I have added some custom CSS to style interior pages with a little pop of color and shadow. The problem is, this is also showing up on the home page of the site. The home page is just a standard page using Beaver Builder for the rows (Not my choice, I inherited this project, lol) but that should not matter right?

    How can I target that specific page to not show my custom CSS with GeneratePress? Here is my CSS I am using:

    div.entry-content {
    background: #fff;
    padding: 22px 20px 30px;
    margin-bottom: 43px !important;
    border-top: 4px solid #F0B400;
    -webkit-box-shadow: 0 1px 5px 0 rgba(0,0,0,0.14);
    -moz-box-shadow: 0 1px 5px 0 rgba(0,0,0,0.14);
    box-shadow: 0 1px 5px 0 rgba(0,0,0,0.14);
    }

    #180021
    Tom
    Lead Developer
    Lead Developer

    If the homepage is the only page you don’t want that CSS to apply to, you can do this:

    body:not(.home) div.entry-content {
        background: #fff;
        padding: 22px 20px 30px;
        margin-bottom: 43px !important;
        border-top: 4px solid #F0B400;
        -webkit-box-shadow: 0 1px 5px 0 rgba(0,0,0,0.14);
        -moz-box-shadow: 0 1px 5px 0 rgba(0,0,0,0.14);
        box-shadow: 0 1px 5px 0 rgba(0,0,0,0.14);
    }
    #180095
    Wayne

    Dang, learn something new everyday! Works fantastic. Thanks homie! Marking as resolved.

    #180100
    Tom
    Lead Developer
    Lead Developer

    You’re welcome!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.