0

I am using below code to change the font-size of the Home Link that appears in the Quick Launch but its not working. Can someone please help me with the correct code.

<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>

<script type="text/javascript">

$(".ms-core-listMenu-verticalBox > .ms-core-listMenu-root > li > .ms-core-listMenu-item:contains('Home')").css('font-size', '2.77em');

</script>

thanks in advance.

1 Answer 1

1

You should try adding your code to document ready event. Something like this:

<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $(".ms-core-listMenu-verticalBox > .ms-core-listMenu-root > li > .ms-core-listMenu-item:contains('Home')").css('font-size', '2.77em');
}); 
</script>
5
  • Damjan, yes it works. Thanks. I actually have to apply the text color #009933 and I tried below but does not work, any help?
    – mdevm
    Jun 7, 2018 at 18:23
  • $(".ms-core-listMenu-verticalBox > .ms-core-listMenu-root > li > .ms-core-listMenu-item:contains('Home')").css('font-size', '2.77em','color','#009933');
    – mdevm
    Jun 7, 2018 at 18:23
  • just split it in two calls: $(".ms-core-listMenu-verticalBox > .ms-core-listMenu-root > li > .ms-core-listMenu-item:contains('Home')").css('color','#009933'); $(".ms-core-listMenu-verticalBox > .ms-core-listMenu-root > li > .ms-core-listMenu-item:contains('Home')").css('font-size', '2.77em'); Jun 7, 2018 at 18:24
  • or better chain the calls: $(".ms-core-listMenu-verticalBox > .ms-core-listMenu-root > li > .ms-core-listMenu-item:contains('Home')").css('color','#009933').css('font-size', '2.77em'); Jun 7, 2018 at 18:25
  • Thanks man, can you check this question and help me with answer as well:sharepoint.stackexchange.com/questions/243082/…
    – mdevm
    Jun 7, 2018 at 18:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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