How To Have A Fixed Div On Footer Of Website

I recently added Bootstrap to my blog. I placed two ads on the blog, one for desktop and one for mobile. Whenever the mobile view was active, I wanted the ad to just stick to the bottom, so I added the following to the div around the mobile ad, into my css.

#footer {
  position:fixed;
  left:0px;
  bottom:0px;
  height:30px;
  width:100%;
  background:#999;
}

The markup would look something like this:

<div id="footer">
  Content for this div here.
</div>

Source: CSS-Tricks