Question

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

Normally I would write something like this:

.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?

Était-ce utile?

La solution

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>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top