html - Angled background (triangle) button on hover -
i have following css/html puts 'back top' button on bottom right corner of window. when hovered over, background animates behind it.
the code works fine, trying triangle instead. in bottom right, , background animate up, on angle instead of straight up.
#top-btn { position: fixed; margin: 0; padding: 0; display: block; bottom: 0; right: 0; z-index: 900; } #top-btn a, #top-btn-bg { position: absolute; right: 0; margin: 0; } #top-btn { z-index: 999; padding: 34px 35px; color: #707070; bottom: 0; } #top-btn-bg { z-index: 950; height: 75px; width: 75px; background-color: #333; bottom: -75px; -webkit-transition: bottom 0.35s ease; -moz-transition: bottom 0.35s ease; -ms-transition: bottom 0.35s ease; -o-transition: bottom 0.35s ease; transition: bottom 0.35s ease; } #top-btn a:hover { color: #fff; } #top-btn a:hover+#top-btn-bg { bottom: 0px; }
<div id="top-btn" class="flex"> <a href="javascript:void(0);" onclick="scrolltop();"> button </a> <div id="top-btn-bg"></div> </div>
i want bottom-right corner triangle when hovered over
just use simple css triangle generator. http://apps.eky.hk/css-triangle-generator/
Comments
Post a Comment