Jimmy
Jimmy

Reputation: 23

RSS Viewer overrides list-item CSS style

I am using SharePoint Online. I have a web part page with a number of web parts with links. Font size of the links is ~12px.

If I add an RSS Viewer web part to the page, then it overrides the 'list-item' class CSS Style to something like 8px, which is unreadable.

To correct this I have tried the following:

  1. Added the following code to a Script Editor Web Part on same page: .item link-item { font-size:20px !important; } .link-item { font-size:20px !important; }

  2. Completely deleted all XSL from the RSS Viewer web part and replaced it with very simple formatting code which format the links within the RSS web part to 16px - but still the other links are set to 8px.

  3. Linked a custom style sheet to the relevant master page and set the link-item classes in there, ensuring that it is executed after the standard SharePoint css.

...but nothing works!

It appears that, as soon as the RSS Viewer web part is added to the page it overrides the list-item style and then will not release it even if all the XSL within the web part is deleted!

On deleting the RSS Viewer from the page and saving it, the links font size returns to normal.

Does anyone have a fix/work around for this?

Thanks in advance,

Jimmy

Upvotes: 1

Views: 466

Answers (1)

Vadim Gremyachev
Vadim Gremyachev

Reputation: 59368

As you correctly noticed there are several ways how to apply custom style sheet to RSS Viewer web part, the following simple solution works for me in SPO (option 1 in your question):

  1. Open the page in Edit mode
  2. Place Script Editor web part at the page
  3. Insert the following CSS:

    <style type="text/css">
    .link-item a, .link-item a:link {
        font-size: 12px;
    }
    </style>
    
  4. Save the changes

Result

enter image description here

Upvotes: 1

Related Questions