SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've removed most of the default elements with the following:

<style type="text/css"> #s4-ribbonrow, .ms-cui-topBar2, .s4-notdlg, .s4-pr s4-ribbonrowhidetitle, .s4-notdlg noindex, #ms-cui-ribbonTopBars, #s4-titlerow, #s4-pr s4-notdlg s4-titlerowhidetitle, #s4-leftpanel-content {display:none !important;}    .s4-ca{margin-left:0px !important; margin-right:0px !important;} </style>

All that I want to add is a simple button like this that takes the user back to the home page. I had something working (kind of), but the css stylesheets were not working. tried using a CEWP (my normal method) and a Page Viewer Web Part (would work, but the dimensions were too large).

just the most basic way to make a nice little button with jQuery.

Here's some more code.. just can't get it to play nicely with SP.

<!doctype html>
<html lang="en">
  <meta charset="utf-8" />
  <title>jQuery UI Button - Default functionality</title>
  <link rel="stylesheet" href="" />
  <script src=""></script>
  <script src=""></script>
  <link rel="stylesheet" href="" />
  $(function() {
    $( "input[type=submit], a" )
      .click(function( event ) {


<!-- <button></button> -->

<!-- <input type="submit" value="RE Home" /> -->

<a href="http://mysite/default.aspx">RE Home</a>

share|improve this question
do you want this button to goto a page or display inside a list for each item? – Stephen Mar 1 '13 at 18:34
just want to go to a page. – Bill Mar 1 '13 at 18:37
up vote 0 down vote accepted

ok if that's what you want this will do it...

<input type=button onClick="parent.location='http://mysite/default.aspx'" value='RE Home'>

Although there are several ways to do this but the above should be right...doing this from memory as I'm on my tablet...

Hope this helps


share|improve this answer
well what the hell - this is so goofy. ok i think i'm learning something here. why are there two references to css stylesheets? – Bill Mar 1 '13 at 18:50
ok thanks - one last question - how can i get the theme to only apply to the button - not the entire page? – Bill Mar 1 '13 at 18:55
I think it best to use CSS to control the look of the button if you want to isolate it from the rest of the look and feel. If you have this working could you mark up the answer? Cheers. – Stephen Mar 3 '13 at 18:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.