2

I have added a content editor web part to my page and added a style for Links, to override the standard link colors. This is working well. But at the moment it is also changing the colors on the links in the Quick launch bar, and all I want it to do is to change the link color in a particular web part. What do I write?

I don't have access to master pages, so I have to do it like this.

Thanks :-)

2

You can go with CSS combinators. Where you can one css class to parent element or else you can go with id of the webpart. below is the example for the same.

.parent-container .yourclassname{
//Your styles here
}

or else

#IDofwebpart  .yourclassname{
//Your styles here
}
2

Thanks, I got it to work :-)

I realised that the content was not placed in a web part, but was displayed in a layout zone (wiki page). So I created a Div around the content and added an class="myclass".

Then I added .myclass to my style. And this is working perfectly :-)

1

The only possible option to achieve this is you have to pick up the Class or ID selector for which you want to apply the custom CSS.

You can use the browser's Inspect Element tool to find the Class or ID of specific links.

Just pick up the selectors and apply your custom CSS on selectors:

Ex:

.selector{
// Your css goes here
}

Or

#selector{
// Your css goes here
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.