Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <!-- create a class of container -->

<div class="container">
<!--  add image inside this container  -->
  
  <img src="https://images.pexels.com/photos/569169/pexels-photo-569169.jpeg?w=940&h=650&auto=compress&cs=tinysrgb" alt="image">
  
<!--  I am using from pexels.com  -->
</div>
              
            
!

CSS

              
                /* style container */
.container{
/*  add width and height to the container  */
  width:400px;
  height: 300px;
  
/*  center the container or position your container according to you  */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  
/* Important point or remember this to style  */
  
/*  what will happen if you don't do this   */
  overflow: hidden;
  
/*  Image will be rotate and scaled with the container so, this is most important  */
  
/* Let's add extra style to the container */
  border: 1px solid #ccc;
  box-shadow: 0px 0px 5px #ccc;
}

/* Let's style our image */

img{
  width: 400px;
  height: 300px;
  
/*  add transition to the container  */
  
  transition: all .5s ease-in-out;
}

/* Hover Effect */

/* This will be processed when container is hovered */

.container:hover img{
/*  scale will increase the width and height of the image  */
  
/*  rotate will rotate your image   */
  transform: scale(1.2) rotate(-5deg);
}

              
            
!

JS

              
                
              
            
!
999px

Console