none
How to remove underline for search result hyperlink RRS feed

  • Question

  • hi friends

          we have a problem about how to remove underline for hyperlink.

          we tried these,but failed

          1.in "content editor" ,

        
    <style>
    
    <!--these all failed->
    .srch-results a:link{text-decoration:none; } 
    
    a:link{text-decoration:none; } 
    
    a{text-decoration:none; } 
    
    
    .nounderline{text-decoration:none;}
    </style>
    
    <script src="/Pages/_layouts/Scripts/jquery-1.7.1.min.js" type="text/javascript"></script><script>
    
    
    $(document).ready(function() {
      //this worked
      //$(".srch-results a").attr("target","_blank");
    
       //these all failed
       $("a").addClass("nounderline");
       $("a:link").addClass("nounderline");
       $(".srch-results a:link").addClass("nounderline");
    
    });
     </script>

    2.in SearchResults.aspx in  sharepoint design

    <style type="text/css">
    .srch-results a:link{text-decoration:none; } 
    a:link{text-decoration:none; }
    a{text-decoration:none; } 
    
    body{
    background-color:transparent;
    }
    .....

    please give me your hand ,thank you 


    In God We Trust


    • Edited by Fiyoung Monday, July 23, 2012 7:46 AM edit
    Monday, July 23, 2012 7:44 AM

Answers

  • hi friends

         in result.aspx ,i right click the page,and get the cource codes ,and copy it to a .html file ,and save it.

        and i open the .html file ,the hyperlink have no underline.

        Why the same code have different effect.in sharepoint environment the hyperlinks also have underline.

        it's weird

        here is the code in content editor

         
    <style type="text/css">
    .ms-WPHeaderTdSelection {
    	DISPLAY: none
    }
    A:link {
    	COLOR: blue; TEXT-DECORATION: none
    }
    A:active {
    	TEXT-DECORATION: blink
    }
    A:hover {
    	COLOR: red; TEXT-DECORATION: underline
    }
    A:visited {
    	COLOR: green; TEXT-DECORATION: none
    }</style><script src="/Pages/_layouts/Scripts/jquery-1.7.1.min.js" type="text/javascript"></script><script>
    
    $(document).ready(function() {
      $(".srch-results a").attr("target","_blank");
    
       });
     </script>

    .

    thank you very much

    Fiyoung


    In God We Trust

    • Marked as answer by Fiyoung Friday, August 10, 2012 1:21 AM
    Monday, July 23, 2012 9:35 AM