willier
willier

Reputation: 79

Adding Fixed sidebar to webpage

My target is the fixed side menu like this on this website: http://www.elated.com/

This is my HTML code:

    <!-- Scroll TEST -->
<ul id="followTab">
    <li>
        <a class="newsletter" href="newsletter/" title="Subscribe to ...">
          <span> Subscribe to ...</span>
        </a>
    </li>
    <li>
        <a class="twitter" href="newsletter/" title="Subscribe to ...">
          <span> Subscribe to ...</span>
        </a>
    </li>
    </ul>

and this is my CSS style

    /* Follow tab */

#followTab {
  list-style: none;
  position: fixed;
  z-index: 5;
  right: 0;
  top: 130px;
  width: 24px;
  padding: 8px 5px;
  border: 3px solid #fff;
  border-right: none;
  -moz-border-radius: 10px 0 0 10px;
  -webkit-border-radius: 10px 0 0 10px;
  border-radius: 10px 0 0 10px;
  -moz-box-shadow: 0 0 7px rgba(0, 0, 0, .6);
  -webkit-box-shadow: 0 0 7px rgba(0, 0, 0, .6);
  box-shadow: 0 0 7px rgba(0, 0, 0, .6);
  background: rgba(239, 91, 10, .75);
  background: -moz-linear-gradient(top, rgba(243, 52, 8, .75), rgba(239, 91, 10, .75));
  background: -webkit-gradient( linear, left top, left bottom, from( rgba(243, 52, 8, .75) ), to( rgba(239, 91, 10, .75) ) );
  background: linear-gradient(top, rgba(243, 52, 8, .75), rgba(239, 91, 10, .75));
}

#followTab li {
  margin: 9px 0 0 0;
  line-height: 0;
}

#followTab li:first-child {
  margin-top: 0;
}

#followTab a {
  display: block;
  width: 24px;
  background-image: url("/css/images/follow-tab-buttons.png");
}

#followTab a span {
  position: absolute;
  top: -999em;
}

#followTab a.newsletter {
  height: 16px;
  background-position: 0 0;
}

#followTab a.newsletter:hover {
  background-position: 0 -16px;
}

#followTab a.rss {
  background-position: 0 -32px;
  height: 24px;
}

#followTab a.rss:hover {
  background-position: 0 -56px;
}

#followTab a.twitter {
  background-position: 0 -80px;
  height: 15px;
}

#followTab a.twitter:hover {
  background-position: 0 -95px;
}

#followTab a.facebook {
  background-position: 0 -110px;
  height: 24px;
}

#followTab a.facebook:hover {
  background-position: 0 -134px;
}

For some reason I am not getting the images to show. Hoping to get some pointers. Live website can be found here

Upvotes: 0

Views: 156

Answers (1)

Tom Pietrosanti
Tom Pietrosanti

Reputation: 4294

You have a problem with the path to your images.

Currently you have: /css/images/follow-tab-buttons.png which is an absolute reference, so it starts at the root of your site.

But your site is located at /NEW/

Either: add /NEW before the image URL (/NEW/css/images/follow-tab-buttons.png) [Not Recommended]

Or remove the leading /css/ to make the URL relative (remember, it needs to be relative to your CSS file) - resulting in images/follow-tab-buttons.png

Upvotes: 1

Related Questions