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

              
                <html lang="es">
<head>
  <title>CSS Filters</title>
  
  <!-- Google Fonts -->
  <link href='https://fonts.googleapis.com/css?family=Raleway:300,700' rel='stylesheet' type='text/css'>
  
  <!-- Metas -->
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
  
</head>
<body>
  <!--Title-->
  <h1>CSS Filters</h1>
  
  <!-- Container -->
  <div class="container">
    
    <!-- Original -->
    <figure class="filter">
      <img src="https://s-media-cache-ak0.pinimg.com/736x/52/d4/b6/52d4b691b9df2e2ae9bedff156e8cf58.jpg" alt="Cat" />
      <figcaption>
        <strong>Original</strong>
      </figcaption>
    </figure>
    
    <!-- Blur -->
    <figure class="filter">
      <img class="blur" src="https://s-media-cache-ak0.pinimg.com/736x/52/d4/b6/52d4b691b9df2e2ae9bedff156e8cf58.jpg" alt="Cat" />
      <figcaption>
        <strong>Blur</strong>
      </figcaption>
    </figure>
    
    <!-- Brightness -->
    <figure class="filter">
      <img class="brightness" src="https://s-media-cache-ak0.pinimg.com/736x/52/d4/b6/52d4b691b9df2e2ae9bedff156e8cf58.jpg" alt="Cat" />
      <figcaption>
        <strong>Brightness</strong>
      </figcaption>
    </figure>
    
    <!-- Contrast -->
    <figure class="filter">
      <img class="contrast" src="https://s-media-cache-ak0.pinimg.com/736x/52/d4/b6/52d4b691b9df2e2ae9bedff156e8cf58.jpg" alt="Cat" />
      <figcaption>
        <strong>Contrast</strong>
      </figcaption>
    </figure>
    
    <!-- Drop-shadow -->
    <figure class="filter">
      <img class="drop-shadow" src="https://s-media-cache-ak0.pinimg.com/736x/52/d4/b6/52d4b691b9df2e2ae9bedff156e8cf58.jpg" alt="Cat" />
      <figcaption>
        <strong>Drop-shadow</strong>
      </figcaption>
    </figure>
    
    <!-- grayscale -->
    <figure class="filter">
      <img class="grayscale" src="https://s-media-cache-ak0.pinimg.com/736x/52/d4/b6/52d4b691b9df2e2ae9bedff156e8cf58.jpg" alt="Cat" />
      <figcaption>
        <strong>Grayscale</strong>
      </figcaption>
    </figure>
    
    <!-- Hue-rotate -->
    <figure class="filter">
      <img class="hue-rotate" src="https://s-media-cache-ak0.pinimg.com/736x/52/d4/b6/52d4b691b9df2e2ae9bedff156e8cf58.jpg" alt="Cat" />
      <figcaption>
        <strong>Hue-rotate</strong>
      </figcaption>
    </figure>
    
    <!-- Invert -->
    <figure class="filter">
      <img class="invert" src="https://s-media-cache-ak0.pinimg.com/736x/52/d4/b6/52d4b691b9df2e2ae9bedff156e8cf58.jpg" alt="Cat" />
      <figcaption>
        <strong>Invert</strong>
      </figcaption>
    </figure>
    
    <!-- Opacity -->
    <figure class="filter">
      <img class="opacity" src="https://s-media-cache-ak0.pinimg.com/736x/52/d4/b6/52d4b691b9df2e2ae9bedff156e8cf58.jpg" alt="Cat" />
      <figcaption>
        <strong>Opacity</strong>
      </figcaption>
    </figure>
    
    <!-- Saturate -->
    <figure class="filter">
      <img class="saturate" src="https://s-media-cache-ak0.pinimg.com/736x/52/d4/b6/52d4b691b9df2e2ae9bedff156e8cf58.jpg" alt="Cat" />
      <figcaption>
        <strong>Saturate</strong>
      </figcaption>
    </figure>
    
    <!-- Sepia -->
    <figure class="filter">
      <img class="sepia" src="https://s-media-cache-ak0.pinimg.com/736x/52/d4/b6/52d4b691b9df2e2ae9bedff156e8cf58.jpg" alt="Cat" />
      <figcaption>
        <strong>Sepia</strong>
      </figcaption>
    </figure>
    
  </div>
</body>
</html>
              
            
!

CSS

              
                /* Default styles */
body
  font-family 'Raleway', sans-serif
  background #222831
  color #EEEEEE
  
h1
  text-align center
  text-transform uppercase
  letter-spacing 5px
  
strong
  font-weight 300

/* Container */
.container
  padding 0.5rem
  display flex
  justify-content space-around
  flex-wrap wrap
  
  .filter
    width 100%
    height auto
    text-align center
    
    img
      width 100%
      border-radius 3px
      
    figcaption
      text-transform uppercase
      letter-spacing 4px
      margin 0.5rem 0 0 0
      
/*Filters*/
.blur
  filter blur(2px)
  
.brightness
  filter brightness(2)
  
.contrast
  filter contrast(1.5)
  
.drop-shadow
  filter drop-shadow(10px 10px 10px rgba(0,0,0,0.9))
  border none !important /* No border */
  
.grayscale
  filter grayscale(1)
  
.hue-rotate
  filter hue-rotate(180deg)
  
.invert
  filter invert(1)
  
.opacity
  filter opacity(0.5)
  
.saturate
  filter saturate(3)
  
.sepia
  filter sepia(1)

/* Media querie */
@media all and (min-width 769px)
  .container
    .filter
      width 24%
  
              
            
!

JS

              
                
              
            
!
999px

Console