Skip to content

Instantly share code, notes, and snippets.

@jbail
Created November 29, 2010 21:37
Show Gist options
  • Save jbail/720670 to your computer and use it in GitHub Desktop.
Save jbail/720670 to your computer and use it in GitHub Desktop.
Making scrollbars on HTML elements using CSS overflow properties
/*
* Make the element scroll on both x and y axes - CSS2
*/
.scroll-both {
overflow:scroll;
}
/*
* Make the element scroll on x axis only - CSS3
*/
.scroll-x {
overflow-x:scroll;
overflow-y:hidden;
}
/*
* Make the element scroll on y axis only - CSS3
*/
.scroll-y {
overflow-y:scroll;
overflow-x:hidden;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment