Search This Blog

2020/04/08

Make a float button in your web page

No need to write JavaScript, just CSS and working in most popular browsers.

<style>
.floatButton {
  z-index: 1000;
  display: block;
  position: fixed;
  bottom: 120px;
  right: 120px;
}
</style>
<div class="floatButton"><button>float </button></div>

z-index: 1000; display: block; position: fixed; is important.

No comments :

Post a Comment