1

How do i remove the underline and hyperlink from a web part title? Specifically i still want the title to appear on this web part, i just don't want it to be a clickable link and i want to remove the underline that appears on hover/click. CSS solution preferred if possible.

I've tried a few searches for similar requests and the solutions don't seem to be working.

any ideas?

0

Try 1

The first idea is Modify Web Part Properties and clear the Title URL field value in the Appearance section. Click OK and first it works ok. But after reloading the page SharePoint automatically fills the Title URL property with the URL of the default view of the list and the link comes back. 😦

Try 2

A workaround can be replacing the Title URL value with a “#”. In this case the link will not disappear but it will point to the actual page. Better, but still far from good. :S

Try 3

The second workaround can be setting the Title URL value with “http://about:blank”. This will still render the title as link but nothing will happen when the user clicks on it. Unfortunately it can be quite misleading for users especially if you have different styles for link than labels (color, underline, hover, etc) :l

Solution

The best solution I can think of is setting Title URL value with some special string such as “###” and using a simple JavaScript or jQuery to remove all the links which point to this string:

The following jQuery will do it. Don’t forget to include a reference to the jQuery library if you haven’t done so.

jQuery(document).ready(function () {

       $('a').filter("[href='###']").each(function () {
        $(this).replaceWith($(this).html());
       });

 });

Source

|improve this answer|||||
  • thank you very much for the suggested solution. I did manage to remove the redirect to a different page by adding # from "try 2". Current issue is just removing the link all together to avoid the underline and pointer coming up to confuse users. I would prefer a CSS solution to this if i can get one but i will definitely mark this as a solution, since it is viable. thank you! – Dylan Dec 12 '19 at 13:41

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.