Skip to content

Instantly share code, notes, and snippets.

@wpsmith
Created January 20, 2015 17:04
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save wpsmith/e50b95bbe1ff20ea9b8a to your computer and use it in GitHub Desktop.
Save wpsmith/e50b95bbe1ff20ea9b8a to your computer and use it in GitHub Desktop.
CSS: Bootstrap fixes for SharePoint
/*bootstrap resets for SharePoint*/
*, *:before, *:after {
-moz-box-sizing: content-box; /*border-box causes many issues with SP*/
}
* [class^="span"], * [class^="span"]:before, * [class^="span"]:after {
-moz-box-sizing: border-box;
}
img {
max-width: none;
width: auto;
}
* [class^="span"] img {
max-width: 100%; /*for images inside span grid*/
}
#scriptWPQ2 img, img.ms-webpart-menuArrowImg, #applist img {
width: auto; /*within a span may still need to have width of image not 100% for SP2013 OOTB features/imges*/
max-width: none;
}
.ms-siteactions-imgspan {
float: none;
margin: 0px;
}
#s4-ribbonrow [class*="span"] {
float: none;
margin-left: 0px;
line-height: 1.2em;
}
input.ms-cui-cb-input {
height: 14px;
padding: 3px 7px 2px;
}
select, input[type="file"] {
height: auto;
line-height: 20px;
}
label {
display: inline-block;
margin-bottom: 0px;
}
/*end bootstrap resets*/
@danawesome
Copy link

Thank you for this CSS code. It was a great help as a starting point to make the changes I needed. I have folked this file and updated it to allow for bootstrap to work within a SharePoint CEWP while blocking it from altering the SharePoint suiteBar and s4-ribbonrow areas.

https://gist.github.com/danawesome/91cba156a096e8a60f85e2e521da6061

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment