3

Is there a common id or css file that I can find on a page that SharePoint loads, whenever I enter "edit mode" for a publishing page? Reason being is because I reeeeallly want to use the following css in my style sheet...

#wrapper * {
padding:0;
margin:0;
}

But that screws up all the webpart zone areas on the page whenever I enter edit mode for a publishing page. If there was a class that loaded when I am in editing mode, I could then work something out on disabling or canceling out my wrapper * process.

Thanks for any advice

  • Why don't you inspect elements that you can only see when the page is in edit mode and take a look at their classes yourself? F12 is your friend. – teylyn Jun 26 '14 at 22:33
5

You could be benefited by using PublishingWebControls:EditModePanel, which will add a class to the root element i.e. html tag, when page enters the edit mode.

<PublishingWebControls:EditModePanel runat="server" > 
    <script type="text/javascript">
            document.documentElement.className += 'editmode';
    </script> 
</PublishingWebControls:EditModePanel> 

CSS may look like:

<style type="text/css">
        /*
        Only apply the hidden style to elements within the HTML element
        that has the editmode class
        */
        .editmode .description {display:none;}
    </style>

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.