• I have a bunch of images I want to sit together on a page with no space between them so I altered my child theme style.css here and changed the line-height to 0px
    #content textarea {
    color: #333;
    font-size: 16px;
    line-height: 0px;
    }
    This worked fine but it changes the line-height on all pages to 0px.
    Is there a way I can target only certain pages with these changes but leave the others as they are?
    My site isn’t live at the moment as im still building it on a local host.
    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter derekbrennan

    (@derekbrennan)

    I’m working with a Twenty Ten Child Theme

    If you can a look at the page you want to make the changes, you will see that there’s a bunch of classes in the body tag.

    Something liks this:
    <body class="home page page-id-256 page-parent page-template-default">

    Each page has an id and you can use that class to be page specific, so you could use something like:

    .page-id-256 #content textarea {
    color: #333;
    font-size: 16px;
    line-height: 0px;
    }

    To adjust the line height on page id 256. I just used that number, but of course your page may have a different number.
    These classes are created using the body_class function() – https://codex.www.ads-software.com/Function_Reference/body_class

    It’s super Awesome!!!!

    Thread Starter derekbrennan

    (@derekbrennan)

    Thank you so much for your help. This worked perfectly.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Alter Line Height On One Page Only’ is closed to new replies.