Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

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

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="overflow-tip bluebox"><span>Hover over or touch me to see the full version of this string. It looks like replaced by tooltip.</span></div>
<div class="stuff">some other stuff</div> 
<div style="clear:both"></div>

<div class="rtl-switch bluebox">Hover over or touch me to see the end of this long string.</div>
<div class="stuff">some other stuff</div> 
<div style="clear:both"></div>

<div class="marquee bluebox">
  <span><span>Hover over or touch me to see animated scrolling of this string. Fancy but buggy. May be still can be improved.</span></span>
</div>
<div class="stuff">some other stuff</div> 
<div style="clear:both"></div><br><br><br><br><br><br><br><br><br><br><br><br><br>
<a href="http://yurigor.com/show-hidden-part-of-truncated-text-on-hover-touch/">See details in my blog</a>
              
            
!

CSS

              
                @import "compass";
$boxWidth: 300px;
.bluebox,.stuff {
  @include box-sizing(border-box);
  padding: 5px;
  width:$boxWidth;
  height:30px;
  border: 1px blue solid;
  background-color: rgba(blue,.4);
  margin-bottom: 5px;
  float:left;
}
.stuff {
  float:left;
  border: 1px gray solid;
  background-color: rgba(gray,.4);
  width: auto;
  margin-left:5px;
}

.overflow-tip {
  white-space:nowrap;
  overflow-x: hidden;
  text-overflow: ellipsis;
  &:active, &:hover {
    overflow-x: visible;
    span {
      position: relative;
      background-color: PaleGoldenRod;
      border: 1px solid gray;
      padding: 3px;
      margin-left: -4px;
    }
    
  }
}

.rtl-switch {
  white-space:nowrap;
  overflow-x: hidden;
  text-overflow: ellipsis;
  &:active, &:hover {
    //text-overflow: clip;
    direction: rtl;
    padding-left:10px;
    &:after {
      content: "\200E‎";
    }
  }
}

.marquee {
  white-space:nowrap;
  overflow: hidden;
  span {
    display: inline-block;
    width: 100%;
    span {
      @include transition(left 4s linear);
      position: relative;
      overflow: hidden;   
      text-overflow: ellipsis;
      left: 0px;
    }   
  }
  &:active, &:hover {
    span {
      width: auto;
      span {
        left:calc(#{$boxWidth} - 15px - 100%);
      }
    }    
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console