+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Loses wrapper centering through sitefinity

Loses wrapper centering through sitefinity

4 posts, 0 answered
  1. Phil C
    Phil C avatar
    28 posts
    Registered:
    06 Sep 2012
    01 Jul 2009
    Link to this post
    Hi, am using the basic wrapper css as below (only the body and #wrapper should affect this problem but rest included in case of clash) to center the 800px content - which works fine (in IE7/8 and FF) outside of Sitefinity and in Viz Studio looking directly at the .master (also at a manually generated page using that .master). BUT Sitefinity feeds it out and the whole content is aligned to the left (although the "Powered By" logo is in the centre, which makes it look even worse!).
    Can't understand why Sitefinity outputs it differently, have looked through the generated source but nothing looks out of place. Any clues as to Sitefinity code handling differently?

    Cheers, Phil.

    body {  
        margin: 0;  
        padding: 0;  
        font-familyVerdanaArialHelveticasans-serif;  
        background-color#FFFFFF;  
        text-aligncenter;  
    }  
    #wrapper {  
        positionrelative;  
        text-alignleft;  
        width800px;  
        margin-rightauto;  
        margin-leftauto;  
        background-repeatno-repeat;*/  
        border-bottom1px solid #ececec;  
    }  
     
    #header {  
        height:138px;  
        position:relative;  
        border-bottom1px solid #ececec;  
    }  
     
    #header h1 {  
        margin: 0;  
        padding: 0;  
        font-weightnormal;  
        color#000000;  
        font-size: 190%;  
        positionabsolute;  
        bottombottom4px;  
        rightright: 0;  
        padding-right4px;  
    }  
     
    #content {  
        float:rightright;  
        width500px;  
        padding: 0 0px 0 0;  
        font-familyVerdanaArialHelveticasans-serif;  
    }  
    #content p {  
        font-size: 99%;  
        line-height: 1.8em;  
    }  
     
     
    #navigation   
    {  
        font-size: 140%;  
        float:left;  
        width120px;  
    }  
     
    #footer {  
        clear:both;  
        font-familyVerdanaArialHelveticasans-serif;  
        font-size: 80%;  
        padding-top: 1em;  
        text-align:rightright;  
        color#999;  
        background-colortransparent;  


    <%@ Master Language="C#" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">  
     
    <head runat="server">  
        <title>Total Site</title> 
        <link href="../App_Themes/Total/Total.css" rel="stylesheet" type="text/css" /> 
        <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
    </head> 
     
    <body> 
        <form id="frmMain" runat="server">  
        <div id="wrapper">  
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
        </telerik:RadScriptManager> 
     
            <div id="header">  
                <h1>Total Header</h1> 
            <img src="../App_Themes/Total/images/masthead.jpg" alt="Total"/>  
            </div> 
            <br /> 
            <div id="content">  
        <asp:ContentPlaceHolder ID="cphMainContent" runat="server">  
        </asp:ContentPlaceHolder> 
            </div> 
            <div id="navigation">  
        <asp:ContentPlaceHolder id="cphMenu" runat="server">  
        </asp:ContentPlaceHolder> 
            </div> 
            <div id="footer">Copyright &copy; 2009</div> 
        </div> 
        </form> 
    </body> 
    </html> 
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    02 Jul 2009
    Link to this post
    Hello Phil C,

    Thank you for using our services.

    We have looked at your master page and it rendered through Sitefinity the same way as it rendered on manually generated pages using that master page you copied. We could only some minor typo-s in the CSS which VS detected.

    Can you please look at your pages in Sitefinity, if you have set them to use any other theme, than the [Template Theme]. I have attached the CSS after removing the typos.

    Greetings,
    Rado
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Phil C
    Phil C avatar
    28 posts
    Registered:
    06 Sep 2012
    02 Jul 2009
    Link to this post
    Many thanks Rado for verifying it's fine in practice and there's no general known issues on this problem (appreciate that there are quite a few places where CSS overriding may occur). Humble apologies for the css typos - overzealous when stripping out the test comments on editor submission.

    So have tested deeper and found the problem - doh, I left a white.css from the copied App_Theme folderset and it conflicts and overrides the centering. Because it only kicks in on runtime, VS didn't show the problem when looking directly at the MasterPage, so an ASP.NET thing, not Sitefinity (the .aspx test page using the master showed fine because I'd also added the CSS manually to the Master for design-time viewing!). Sorry about that, should have dumped unneeded CSS and kept Theme folder clean - not used to using them, but know now!

    For the best Master Page setup to save these kind of issues, it's naturally best to do a reality check on a page from master without any hardcoded css links, that way it will be practically the same as Sitefinity Template handling. The only way to do that is to use styleSheetTheme not just theme in the web.config:
     
    <system.web>      
         <pages theme="<theme-name>" styleSheetTheme="<theme-name>"

    This may hopefully save others from my erroneous path! Cheers,

    Phil
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    03 Jul 2009
    Link to this post
    Hi Phil C,

    We are glad that you were able to sort this out, and appreciate your feedback.

    If you have any other concerns, please feel free to contact us, we will be happy to assist yo.

    Best wishes,
    Rado
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
4 posts, 0 answered