Changing appearance of web parts in SharePoint 2013 using CSS











up vote
1
down vote

favorite












I have built a site in SharePoint and would now like to change the appearance of web parts (document libraries) using CSS.



Whenever I add the following CSS code:



<style type="text/css">
.ms-webpart-titleText.ms-webpart-titleText, .ms-webpart-titleText > a {
background-color: darkblue;
font-size: 18px;
font-weight: bold;
color: white;
padding: 5px 5px;}
</style>


...I find that the preview window in my web browser shows a change has taken place.
enter image description here



Unfortunately, when I apply the changes and view the page again, the web part has reverted to the default appearance.



enter image description here



Does anyone have any ideas what could be causing this to happen?










share|improve this question


















  • 1




    Try using SharePoint designer :)
    – Samuel Nicholson
    Jul 14 '14 at 14:34















up vote
1
down vote

favorite












I have built a site in SharePoint and would now like to change the appearance of web parts (document libraries) using CSS.



Whenever I add the following CSS code:



<style type="text/css">
.ms-webpart-titleText.ms-webpart-titleText, .ms-webpart-titleText > a {
background-color: darkblue;
font-size: 18px;
font-weight: bold;
color: white;
padding: 5px 5px;}
</style>


...I find that the preview window in my web browser shows a change has taken place.
enter image description here



Unfortunately, when I apply the changes and view the page again, the web part has reverted to the default appearance.



enter image description here



Does anyone have any ideas what could be causing this to happen?










share|improve this question


















  • 1




    Try using SharePoint designer :)
    – Samuel Nicholson
    Jul 14 '14 at 14:34













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I have built a site in SharePoint and would now like to change the appearance of web parts (document libraries) using CSS.



Whenever I add the following CSS code:



<style type="text/css">
.ms-webpart-titleText.ms-webpart-titleText, .ms-webpart-titleText > a {
background-color: darkblue;
font-size: 18px;
font-weight: bold;
color: white;
padding: 5px 5px;}
</style>


...I find that the preview window in my web browser shows a change has taken place.
enter image description here



Unfortunately, when I apply the changes and view the page again, the web part has reverted to the default appearance.



enter image description here



Does anyone have any ideas what could be causing this to happen?










share|improve this question













I have built a site in SharePoint and would now like to change the appearance of web parts (document libraries) using CSS.



Whenever I add the following CSS code:



<style type="text/css">
.ms-webpart-titleText.ms-webpart-titleText, .ms-webpart-titleText > a {
background-color: darkblue;
font-size: 18px;
font-weight: bold;
color: white;
padding: 5px 5px;}
</style>


...I find that the preview window in my web browser shows a change has taken place.
enter image description here



Unfortunately, when I apply the changes and view the page again, the web part has reverted to the default appearance.



enter image description here



Does anyone have any ideas what could be causing this to happen?







css sharepoint-2013






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jun 7 '14 at 11:51









Austin ''Danger'' Powers

4,979113558




4,979113558








  • 1




    Try using SharePoint designer :)
    – Samuel Nicholson
    Jul 14 '14 at 14:34














  • 1




    Try using SharePoint designer :)
    – Samuel Nicholson
    Jul 14 '14 at 14:34








1




1




Try using SharePoint designer :)
– Samuel Nicholson
Jul 14 '14 at 14:34




Try using SharePoint designer :)
– Samuel Nicholson
Jul 14 '14 at 14:34










4 Answers
4






active

oldest

votes

















up vote
0
down vote













What is likely to be happening is that wherever you are loading that CSS, it is being overridden by the standard CSS.



You can try adding the !important tag to the end of the entry. You should check out the code using web developer tools in the browser to make sure that the CSS is actually being loaded and not dropped by SharePoint and find out what might be taking preference to your code. Using Firefox with the Firebug addin should assist greatly.



Let us know:




  • Exactly what webpart you are trying to change

  • How & where you are inserting the CSS

  • What page layout and master page you are using






share|improve this answer




























    up vote
    0
    down vote













    Your Web Part Chrome Type might be the problem. You will be able to see changes on edit mode, but if your Chrome Type is set to Default, None, or Border Only, you will not see the title on the actual page.



    On your Title on the edit mode page, go to the far right, and click on the drop down menu. Click on Edit Web Part, and go to Appearance. There you should find the Chrome Type settings. This can also be done in SharePoint Designer.






    share|improve this answer






























      up vote
      0
      down vote













      I would create ".txt" file store in site assets library, and just call out this text file in content editor.






      share|improve this answer

















      • 1




        Why would you use this approach? What benefit does it have over other methods? Currently this answer is more suited to be a comment.
        – Burgi
        May 13 '16 at 19:48


















      up vote
      0
      down vote













      It's probably because you are trying to EMBED style code, which gets deleted when you save the page. Instead, use a CEWP with an external .txt file, or you can use the Script Editor Web Part with style code.






      share|improve this answer





















        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "3"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f764842%2fchanging-appearance-of-web-parts-in-sharepoint-2013-using-css%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        0
        down vote













        What is likely to be happening is that wherever you are loading that CSS, it is being overridden by the standard CSS.



        You can try adding the !important tag to the end of the entry. You should check out the code using web developer tools in the browser to make sure that the CSS is actually being loaded and not dropped by SharePoint and find out what might be taking preference to your code. Using Firefox with the Firebug addin should assist greatly.



        Let us know:




        • Exactly what webpart you are trying to change

        • How & where you are inserting the CSS

        • What page layout and master page you are using






        share|improve this answer

























          up vote
          0
          down vote













          What is likely to be happening is that wherever you are loading that CSS, it is being overridden by the standard CSS.



          You can try adding the !important tag to the end of the entry. You should check out the code using web developer tools in the browser to make sure that the CSS is actually being loaded and not dropped by SharePoint and find out what might be taking preference to your code. Using Firefox with the Firebug addin should assist greatly.



          Let us know:




          • Exactly what webpart you are trying to change

          • How & where you are inserting the CSS

          • What page layout and master page you are using






          share|improve this answer























            up vote
            0
            down vote










            up vote
            0
            down vote









            What is likely to be happening is that wherever you are loading that CSS, it is being overridden by the standard CSS.



            You can try adding the !important tag to the end of the entry. You should check out the code using web developer tools in the browser to make sure that the CSS is actually being loaded and not dropped by SharePoint and find out what might be taking preference to your code. Using Firefox with the Firebug addin should assist greatly.



            Let us know:




            • Exactly what webpart you are trying to change

            • How & where you are inserting the CSS

            • What page layout and master page you are using






            share|improve this answer












            What is likely to be happening is that wherever you are loading that CSS, it is being overridden by the standard CSS.



            You can try adding the !important tag to the end of the entry. You should check out the code using web developer tools in the browser to make sure that the CSS is actually being loaded and not dropped by SharePoint and find out what might be taking preference to your code. Using Firefox with the Firebug addin should assist greatly.



            Let us know:




            • Exactly what webpart you are trying to change

            • How & where you are inserting the CSS

            • What page layout and master page you are using







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jun 7 '14 at 16:43









            Julian Knight

            12.9k11535




            12.9k11535
























                up vote
                0
                down vote













                Your Web Part Chrome Type might be the problem. You will be able to see changes on edit mode, but if your Chrome Type is set to Default, None, or Border Only, you will not see the title on the actual page.



                On your Title on the edit mode page, go to the far right, and click on the drop down menu. Click on Edit Web Part, and go to Appearance. There you should find the Chrome Type settings. This can also be done in SharePoint Designer.






                share|improve this answer



























                  up vote
                  0
                  down vote













                  Your Web Part Chrome Type might be the problem. You will be able to see changes on edit mode, but if your Chrome Type is set to Default, None, or Border Only, you will not see the title on the actual page.



                  On your Title on the edit mode page, go to the far right, and click on the drop down menu. Click on Edit Web Part, and go to Appearance. There you should find the Chrome Type settings. This can also be done in SharePoint Designer.






                  share|improve this answer

























                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    Your Web Part Chrome Type might be the problem. You will be able to see changes on edit mode, but if your Chrome Type is set to Default, None, or Border Only, you will not see the title on the actual page.



                    On your Title on the edit mode page, go to the far right, and click on the drop down menu. Click on Edit Web Part, and go to Appearance. There you should find the Chrome Type settings. This can also be done in SharePoint Designer.






                    share|improve this answer














                    Your Web Part Chrome Type might be the problem. You will be able to see changes on edit mode, but if your Chrome Type is set to Default, None, or Border Only, you will not see the title on the actual page.



                    On your Title on the edit mode page, go to the far right, and click on the drop down menu. Click on Edit Web Part, and go to Appearance. There you should find the Chrome Type settings. This can also be done in SharePoint Designer.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Apr 30 '15 at 4:08









                    RockPaperLizard

                    3,054133568




                    3,054133568










                    answered Apr 29 '15 at 16:34









                    Adrian Garcia

                    1




                    1






















                        up vote
                        0
                        down vote













                        I would create ".txt" file store in site assets library, and just call out this text file in content editor.






                        share|improve this answer

















                        • 1




                          Why would you use this approach? What benefit does it have over other methods? Currently this answer is more suited to be a comment.
                          – Burgi
                          May 13 '16 at 19:48















                        up vote
                        0
                        down vote













                        I would create ".txt" file store in site assets library, and just call out this text file in content editor.






                        share|improve this answer

















                        • 1




                          Why would you use this approach? What benefit does it have over other methods? Currently this answer is more suited to be a comment.
                          – Burgi
                          May 13 '16 at 19:48













                        up vote
                        0
                        down vote










                        up vote
                        0
                        down vote









                        I would create ".txt" file store in site assets library, and just call out this text file in content editor.






                        share|improve this answer












                        I would create ".txt" file store in site assets library, and just call out this text file in content editor.







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered May 13 '16 at 16:45









                        user593713

                        1




                        1








                        • 1




                          Why would you use this approach? What benefit does it have over other methods? Currently this answer is more suited to be a comment.
                          – Burgi
                          May 13 '16 at 19:48














                        • 1




                          Why would you use this approach? What benefit does it have over other methods? Currently this answer is more suited to be a comment.
                          – Burgi
                          May 13 '16 at 19:48








                        1




                        1




                        Why would you use this approach? What benefit does it have over other methods? Currently this answer is more suited to be a comment.
                        – Burgi
                        May 13 '16 at 19:48




                        Why would you use this approach? What benefit does it have over other methods? Currently this answer is more suited to be a comment.
                        – Burgi
                        May 13 '16 at 19:48










                        up vote
                        0
                        down vote













                        It's probably because you are trying to EMBED style code, which gets deleted when you save the page. Instead, use a CEWP with an external .txt file, or you can use the Script Editor Web Part with style code.






                        share|improve this answer

























                          up vote
                          0
                          down vote













                          It's probably because you are trying to EMBED style code, which gets deleted when you save the page. Instead, use a CEWP with an external .txt file, or you can use the Script Editor Web Part with style code.






                          share|improve this answer























                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            It's probably because you are trying to EMBED style code, which gets deleted when you save the page. Instead, use a CEWP with an external .txt file, or you can use the Script Editor Web Part with style code.






                            share|improve this answer












                            It's probably because you are trying to EMBED style code, which gets deleted when you save the page. Instead, use a CEWP with an external .txt file, or you can use the Script Editor Web Part with style code.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jul 11 '16 at 12:49









                            Jill

                            1




                            1






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Super User!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.





                                Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                Please pay close attention to the following guidance:


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f764842%2fchanging-appearance-of-web-parts-in-sharepoint-2013-using-css%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Plaza Victoria

                                Puebla de Zaragoza

                                Musa