Pen Settings



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


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


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.


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.


                <div class="announcements-container">
  <div class="container-title">New Blog Posts</div>
  <ul class="announcements">
    <li><a href="" title="#">Jekyll search using Google’s Custom Search Engine and jQuery. @2017-11-15T15:54:27+00:00.</a></li>
    <li><a href="" title="#">Creating and integrating Spotify’s Now playing track to Open Broadcaster Software (OBS) using C#. @2017-10-23T22:09:27+00:00.</a></li>
    <li><a href="" title="#">Creating and Implementing a beginner friendly scroll-to-top button for your website. @2017-10-17T05:05:27+00:00.</a></li>
    <li><a href="" title="#">CSS Pseudo classes manipulation using jQuery. @2017-10-12T12:21:27+00:00.</a></li>


                /** Fonts **/
@import url("|PT+Sans");

$opensanscondensed: "Open Sans Condensed", sans-serif;
$ptsans: "PT Sans", sans-serif;
$regularFontSize: 13px;

/** Variables **/
$pageBackground: #616161;
$announcementContainerHeight: 40px;

/** Mixins **/

@mixin left-border-radius($rad) {
  -webkit-border-top-left-radius: $rad;
  -webkit-border-bottom-left-radius: $rad;
  -moz-border-radius-topleft: $rad;
  -moz-border-radius-bottomleft: $rad;
  border-top-left-radius: $rad;
  border-bottom-left-radius: $rad;

@mixin transitionize($type, $sec) {
  -webkit-transition: $type $sec ease-out;
  -moz-transition: $type $sec ease-out;
  -o-transition: $type $sec ease-out;
  transition: $type $sec ease-out;

body {
  background: $pageBackground;

  .announcements-container {
    width: 65%;
    background: #f5f5f5;
    overflow: hidden;
    position: absolute;
    top: 40%;
    left: 20%;
    display: inline-block;
    font-family: $ptsans;
    height: $announcementContainerHeight;
    line-height: $announcementContainerHeight;
    @include left-border-radius(4px);
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);

			box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.2);  
    .container-title {
      width: 13%;
      height: 100%;
      overflow: hidden;
      padding: 0 15px 0 15px;
      float: left;
      background: #03a9f4;
      text-align: center;
      font-size: $regularFontSize;
      text-transform: uppercase;
      color: white;
      letter-spacing: 1px;

      @include left-border-radius(2px);

      img {
        width: 16px;
        height: 16px;
        vertical-align: middle;
        margin: -5px 3px 0 0;

    ul.announcements {
      width: (100%-(18%+15%));
      float: left;
      height: $announcementContainerHeight;
      overflow: hidden;
      list-style-type: none;
      vertical-align: middle;

      li {
        width: 100%;
        overflow: hidden;
        font-size: $regularFontSize + 1;
        margin: -15px 0 0 0;
        vertical-align: middle;
        padding: 0;
        line-height: $announcementContainerHeight;
        text-align: left;
        white-space: nowrap;
        text-overflow: ellipsis;

        a {
          width: 100%;
          text-decoration: none;
          color: #212121;
          @include transitionize(color, 0.5s);

          &:hover {
            color: #03a9f4;
          &:visited {
            color: #616161;


  News Ticker - Prashant Shrestha
  Date: 2018-03-03

var hoveredAnnouncement = null;

function announcementTicker() {
    .filter(function(item) {
      return !$(this).is(hoveredAnnouncement);
    .each(function() {
        .slideUp(function() {
          var announcement = $(this).closest(".announcements");
setInterval(announcementTicker, 5000);

$(function() {  
    function() {
      hoveredAnnouncement = $(this);
    function() {
      hoveredAnnouncement = null;