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="button">
    <p class="btnText">HOVER</p>
    <div class="btn">
      <p class="btnText2">X</p>



                /*Imports Roboto from Google fonts */
html, body {
  /* Background color */
  background : #eee; 
  /* Text font */
  font-family : Roboto; 
  /* Background covers the entire page */
  height: 100%; 
  width: 100%; 
  /* No margin */
  margin: 0;}

.button {
  position: relative;
  /* Position from top of screen */
  top: 100px;
  /* button color */
  background: #3D4C53;
  margin : 20px auto;
  /* Button size */
  width : 200px;
  height : 50px;
  /* Hides the "X" */
  overflow: hidden;
  /* Centers the shown text */
  text-align : center;
  /* Duration of hover transition */
  transition : .4s;
  /* Pointer cursor implemented */
  cursor : pointer;
  /* Curves the edges of the button */
  border-radius: 3px;
.btn {
  position : relative;
  /* Button size  and position*/
  width : 200px;
  height : 100px;
  margin-top: -100px;
  padding-top: 2px;
  /* Button color */
  background : #26A69A;
  /* Shows the first text "Hover" while hiding "X" */
  left : -250px;
  /* Transition duration */
  transition : .3s;
.btnText {
  /* Color and timing of "hover" text */
  color : #fff;
  transition : .3s;

.btnText2 {
  margin-top : 63px;
  /* Hides the "X" button by sending it to the right */
  margin-right : -130px;
  /* Button color to white */
  color : #FFF;

.button:hover .btn{ /*When hovering over .button change .btn*/
  left: -130px;
.button:hover .btnText{ /*When hovering over .button change .btnText*/
  margin-left : 65px;