WordPress – Targetting a specific CSS selector on a specific page

There is a CSS selector that I want to target, but only on one specific page.

Normally I would write something like this:

Read More
.page-id-70 a{
    text-decoration: underline;
}

But this selector is in a different form, it’s inside brackets:

[class*="span"]  {
    margin-left: 82px;
}

Is there a way to target a selector like that on a single page ID?

Related posts

Leave a Reply

1 comment

  1. The best way to do this is to either use Developer Tools (Chrome is usually the best), and right click on the DOM element and select ‘Copy CSS Path’.

    Although, if this exact path is also on other pages, it may be best to include the class you want to modify within the page itself. For example, in the WordPress edit, just add <style> .myClass{ styles here } </style> at the top of the edit box.

    For example, go to the page that you would like to edit. Make sure you are in the text or html view, not the visual view. Then paste the following at the very top:

    <style>
    #boxedWrapper > div:nth-child(5) > div.span12.animated.activate.fadeIn {
        margin-left:82px;
    }
    </style>