Centering content area and fixing page width in Office 365 Sharepoint Online 2013 public site

center-contentOne of the stranger design choices in the layout of 2013 public sites, is the”narrow”, left aligned page content area in the Oslo template. Nothing makes a site look more unprofessional or unfinished than awkwardly aligned content areas. It creates a terrible first impression and even though Msft must be aware of the issue from the many complaints about it they’ve seen in the community forum, it still hasn’t been addressed.That’s amazing considering a couple of lines of css code would fix it. The cause appears to be simple: Microsoft allowed space for the right sidebar the Berlin template uses, but then forgot to correct that in Oslo which has no right sidebar. You can see in this demo example how it’s supposed to look »
To get your site looking like that by centering the content areaand fixing the strangely narrow width, add some css rules to your site’s stylesheet
Under “Site” in the ribbon when editing a page, open the stylesheet

At the top, add this, adjusting the pixels to suit:
.contentwrapper div {margin-left:auto !important;margin-right:auto !important;}
div#contentBox{min-width:885px;} *See note below
Page Layouts
The above should address the content areacontainer, but if you are using a page layout comprised of different sections, you may also need to target those sections to get a balanced look. You can get the relevant classes/id’s by looking at the page source code or using a browser developer tool. Here are some examples of the many classes in use:
div.fullPageLayout-inner{min-width:685px !important;}
Header/2 column layout: div.layout-col.twoRowTwoColumn-bottomLeft, div.layout-col.twoRowTwoColumn-bottomRight {width:50% !important}

Blog Pages
If you use the 365 blog, you may notice the right sidebar still overlaps the post content area after applying the fix above. That’s because, unfortunately, Msft still uses html tables for layouts in the blog pages, so a different fix is needed. To complicate things further, Chrome and other webkit browsers don’t treat tables the same way as other browsers…To target just the post content and the table it’s contained in without impacting other tables on the site in MOST major browsers, add this to the stylesheet:
ul.ms-blog-postList, .ms-blog-MainArea .ms-fullWidth table {min-width:750px !important;margin-right:20px !important;}
Adjust the width to suit of course.

Impact On Mobile Site Design
You’ll need to consider the impact of adding a”min-width” rule on your mobile design, if that’s important to you. Take a look at this article for some tips on how to improve mobile views in 365: Improve the mobile view for Office 365 Sharepoint Online public sites.

If you have a question about this or any other Office 365 topic, please visit my forum. I’m also available for consultations or development work!
And if you found this helpful, feel free to share it socially byclicking one of the icons up top!

Emails Not Arriving in Office 365 Exchange? Beat The SPF Trap!

040314_0230_emailsnotar1After setting up O365 Exchange email, and either dutifully adding all the dns records MSFT requires or allowing MSFT to create them if on the Small Business plan, many people report that they stop receiving messages from web site contact forms or other 3rd party services that use their domain in the from address. The messages don’t go to junk – they just disappear. The usual support response is to whitelist the email address/domain, check with the isp and send ndr’s. That might help if the emails are actually reaching Exchange. But it’s likely they are not – and are getting blocked by an isp because the instructions MSFT provides for creating an SPF dns recordare inaccurate or at best, incomplete. The record may be specifically excluding any server but their own from sending emails. This may be an even more significant problemif you have a Small Business tenant and elect to use MSFT’s nameservers, because the provided spf record can’t be edited.What is an SPF record?
An SPF record helps isp’s and receiving email services detect “spoofed” emails. “Spoofing” is the practice of sending emails using someone else’s domain in the from address in an attempt to beat spam filters and get the recipient to trust the email. Changing a “from” address is easy, but changing the server address the email is sent from is not – so an spf record can be used to let the isp know whether or not a server or ip address is allowed to send email using a particular domain.
The Trap
That’s a good thing but it has a potential downside. An SPF record can be formatted to EXCLUDE any other email server or ip address – in which case an isp that checks your SPF record will reject emails from servers you haven’t specifically authorized to send email from your domain.
Unfortunately that’s exactly what MSFT’s recommended SPF record does.
“v=spf1 include:outlook.com ~all ” tells an isp: ONLY EMAILS ORIGINATING FROM OUTLOOK.COM ARE ALLOWED TO USE THIS DOMAIN.
The “~all” EXCLUDES any other server or ip so when your web site or other email sending service send emails from their own server, not outlook.com, an isp may reject their messages.
A typical example would be emails generated by a WordPress site contact form. The originating server would be the site hosting server. If its address is not included in the spf record it will get sent but likely end up in a black hole and never received.

The Fix
The MSFT instructions should tell us to add “include:outlook.com” to an existing SPF record, or make sure to add an SPF record that includes ALL the sending services that may be using a domain. So if you manage your own dns and send emails from services that use your domain, get their ip address or server name and add them to your SPF record. You can only have one SPF, so format it as follows, substituting in your own information:
v=spf1 mx ip4:109.123.124.162/32 ip4:198.91.81.8/32 include:sendgrid.netinclude:zoho.cominclude:outlook.com~all
What that tells an isp is emails sent using my domain from ONLY those 5 locations are legit – which is exactly what you want.
Small Business Tenants Using MSFT’s Nameservers

If you’re not managing your own dns, you won’t be able to edit the spf record MSFT automatically created for you. You can still fix the problem but it will require switching nameservers and manually adding/editing the records MSFT provides.