문제

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?

도움이 되었습니까?

해결책

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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top