add bottom to top button · DishaSethi/30DaysOfJavaScript@d578de3 · GitHub
Skip to content

Commit d578de3

Browse files
committed
add bottom to top button
1 parent 800a00f commit d578de3

3 files changed

Lines changed: 42 additions & 0 deletions

File tree

‎30DaysOfJavaScript/script.js‎

Lines changed: 14 additions & 0 deletions

‎30DaysOfJavaScript/style.css‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,26 @@ footer a:visited {
100100
flex-direction: column;
101101
}
102102
}
103+
104+
.scrollToTop {
105+
position:fixed;
106+
right:10px;
107+
bottom:10px;
108+
cursor:pointer;
109+
width:50px;
110+
height:50px;
111+
background-color:#5520b6;
112+
border-radius:50%;
113+
}
114+
.scrollToTop span {
115+
position:absolute;
116+
top:50%;
117+
left:50%;
118+
margin-left:-8px;
119+
margin-top:-12px;
120+
border:8px solid transparent;
121+
border-bottom-color:white;
122+
}
123+
.scrollToTop:hover {
124+
background-color:#5836D8;
125+
}

‎index.html‎

Lines changed: 5 additions & 0 deletions

0 commit comments

Comments
 (0)