Skip to content

Commit 6ed53d2

Browse files
updating readme, adding viewport meta, addding overscroll-behavior to body element to stop scroll bounce on mobile
1 parent d89f09b commit 6ed53d2

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

overscroll-behavior/index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width">
56
<title>overscroll-behavior demo</title>
67
<link href="style.css" rel="stylesheet">
78
<script src="main.js" defer></script>
@@ -13,9 +14,6 @@ <h1>overscroll-behavior demo</h1>
1314
<main>
1415

1516
</main>
16-
<footer>
17-
<p>Copyright nobody; have fun.</p>
18-
</footer>
1917
<section class="chatbox">
2018
<header>
2119
<h2>Active chat</h2>
@@ -33,5 +31,8 @@ <h2>Active chat</h2>
3331
<button>Send</button>
3432
</form>
3533
</section>
34+
<footer>
35+
<p>Copyright nobody; inspired by <a href="https://ebidel.github.io/demos/chatbox.html">ebidel's chatbox demo</a>.</p>
36+
</footer>
3637
</body>
3738
</html>

overscroll-behavior/style.css

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ html {
1010

1111
body {
1212
margin: 0;
13+
/* Use overscroll-behavior to stop the "bounce" effect you get on mobile
14+
browsers when getting to the top or bottom scroll limits of the page */
15+
overscroll-behavior: none;
1316
}
1417

1518
/* Styling of contacts */
@@ -36,6 +39,10 @@ p {
3639
margin: 0;
3740
}
3841

42+
a {
43+
color: #ccc;
44+
}
45+
3946
main div p {
4047
line-height: 20px;
4148
}
@@ -67,8 +74,8 @@ header {
6774

6875
.messages p {
6976
margin: 10px;
70-
padding: 5px;
71-
border: 1px solid black;
77+
padding: 10px;
78+
border-radius: 3px;
7279
}
7380

7481
.me {
@@ -77,6 +84,7 @@ header {
7784

7885
.you {
7986
background-color: #eee;
87+
text-align: right;
8088
}
8189

8290
.chatbox form {

0 commit comments

Comments
 (0)