Pen Settings

↑ Insert the most common viewport meta tag

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource
via CSS Lint

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource
via JS Hint

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Want a Run Button?

If active, the preview will update automatically when you change code.


        Draggable overflow for long sentences without the space
        "Such is the nature of men, that howsoever they may acknowledge many others to be more witty, or more eloquent, or more learned; yet they will hardly believe there to be many so wise as themselves." - Thomas Hobbes



              @import "compass/css3";

$bg: thistle;
$text: #000;
$drag-bg: $bg;
$fade-start: rgba($bg,0.8);
$fade-end: $bg;
$fade-size: 2em;
$fade-border: 1px solid desaturate(darken($bg,20),50);

@import url(;
html {
	font-size: 10px;
body {
	background: $bg;
	margin: 0;
	font-family: Source Sans Pro, Open Sans, Helvetica, sans-serif;
	font-size: 1.6rem;
  color: $text;
* {
	box-sizing: border-box;

.content {
	margin: 0;
	padding: 5rem 2rem;

.draggable {
	max-width: 60rem;
	margin: 3rem auto;
	background-color: $drag-bg;
  position: relative;
  overflow: hidden;
  cursor: col-resize;
  user-select: none;
  &.big {
    font-size: 4rem;
  &.nodrag {
    cursor: default;
    user-select: none;
  .draggable-wrap {
    white-space: nowrap;
    position: relative;
    left: 0px;
  .draggable-inner {
    display: inline-block;
    padding: 1rem $fade-size;
  &:before, &:after {
    content: '';
  	display: block;
  	position: absolute;
    width: $fade-size;
    height: 100%;
    z-index: 10;
  &:before {
    @include background(linear-gradient(right, $fade-start, $fade-end));
    border-right: $fade-border;
  &:after {
    right: 0;
    top: 0;
    @include background(linear-gradient(left, $fade-start, $fade-end));
    border-left: $fade-border;
  &.left:before, &.right:after {
    display: none;


              $(document).ready(function() {

  $('.draggable').each(function() {
    var $this = $(this);
    $this.addClass('left right');
    if ($this.width() < $this.find('.draggable-inner').outerWidth()) {
    } else {

  $('.draggable').on('mousedown', '.draggable-wrap', function(e) {
    var $this = $(this);
    var x = e.pageX-parseInt($this.css('left'));
    $this.addClass('dragging').parents().on('mousemove', function(e) {
      var $drag = $('.dragging');
      var left = e.pageX-x;
      $drag.closest('.draggable').removeClass('left right');
      if (left > 0) {
        left = 0;
      if (left < -$drag.find('.draggable-inner').outerWidth()+$drag.width()) {
        left = -$drag.find('.draggable-inner').outerWidth()+$drag.width();
      $drag.css({left: left});
      $drag.on('mouseup', function() {
  $(document).on('mouseup', function() {

Loading ..................