none
Centering content inside of the s4-bodyContainer

    Question

  • I am changing the CSS in order to customize the layout. I want to center the content inside of the bodyContainer. For instance, there is the body container, which I have colored red, I need to center the content that is inside of that, not the text, but the entire table. Which CSS class should I modify? Thank you.


    EDIT: I want to center the Page Content, inside of the .ms-pub-contentLayout Box.
    Saturday, December 21, 2013 3:56 PM

Answers

  • Steven is right.

    I think you are referring to  SharePoint 2013 Oslo master page

    you should override ms-pub-contentLayout or add a new style

    contentBox uses these two styles "ms-pub-contentLayout" and "ms-verticalAlignTop"

    "ms-verticalAlignTop" is used for setting vertical align to top, and it has been referred along with tableCell, changing this will have unwanted repercussions in other areas.

    see the below screenprint from IE Dev tools -

    You may be aware of this link, just providing for your reference  -

    http://msdn.microsoft.com/en-us/library/office/dn205275.aspx



    MCITP: SharePoint 2010 Administrator
    MCTS - MOSS 2007 Configuring, .NET 2.0
    | SharePoint Architect | Evangelist |
    http://www.sharepointdeveloper.in/
    http://ramakrishnaraja.blogspot.com/


    Sunday, December 22, 2013 9:15 AM

All replies

  • Take a look at this link: http://www.thesitewizard.com/css/center-div-block.shtml


    Dimitri Ayrapetov (MCSE: SharePoint)

    Saturday, December 21, 2013 6:56 PM
  • I understand how to code it in CSS, but I cannot find the CSS class that has the power to change it. I have tried almost every CSS class and ID in the oslo.html file. Do you know which one it is?
    Saturday, December 21, 2013 9:18 PM
  • If you're using a publishing site, you can override that class with local CSS.  Add the text-align rule to a css with the name ms-pub-contentLayout and add the !important rule to it and stick it within the Styles library.  There should be a CSS directory in there.  The end product should be the original CSS code with your text change applied to it.

    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles: CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

    Sunday, December 22, 2013 1:29 AM
  • Steven is right.

    I think you are referring to  SharePoint 2013 Oslo master page

    you should override ms-pub-contentLayout or add a new style

    contentBox uses these two styles "ms-pub-contentLayout" and "ms-verticalAlignTop"

    "ms-verticalAlignTop" is used for setting vertical align to top, and it has been referred along with tableCell, changing this will have unwanted repercussions in other areas.

    see the below screenprint from IE Dev tools -

    You may be aware of this link, just providing for your reference  -

    http://msdn.microsoft.com/en-us/library/office/dn205275.aspx



    MCITP: SharePoint 2010 Administrator
    MCTS - MOSS 2007 Configuring, .NET 2.0
    | SharePoint Architect | Evangelist |
    http://www.sharepointdeveloper.in/
    http://ramakrishnaraja.blogspot.com/


    Sunday, December 22, 2013 9:15 AM