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

              
                <div class="container">
  <h2>Linear Gradients</h2>
  <div class="row1">
    <div class="item default-linear-grad">Default</div>
    <div class="item linear-grad-to-top">to top</div>
    <div class="item linear-grad-70-deg">70deg</div>
  </div>
  <h2>Radial Gradients</h2>
  <div class="row2">
    <div class="item closest-side">closest-side</div>
    <div class="item closest-corner">closest-corner</div>
    <div class="item farthest-side">farthest-side</div>
    <div class="item farthest-corner">farthest-corner</div>
    <div class="item circle">circle</div>
    <div class="item ellipse">ellipse</div>
  </div>
  <p>
    Design & Code by <a href="https://codepen.io/adsingh14">AMAN</a>
  </p>
</div>
              
            
!

CSS

              
                body {
  display: flex;
  justify-content: center;
  background: #333;
  color: #fff;
  font: 300 16px "Raleway", "Segoe UI";
  height: 90vh;
  text-align: center;
}
.container {
  position: absolute;
  top: 0;
}
p {
  color: #bbb;
  font-size: 80%;
  padding-top: 20px;
}
a {
  color: #03a9f4;
  text-decoration: none;
}
.item {
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 5px 10px #222;
  padding: 5px;
}

.row1 {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-template-rows: 100px;
  grid-gap: 1em;
  margin-bottom: 2em;

  display: -ms-grid;
  -ms-grid-columns: 100px 1em 100px 1em 100px;
  -ms-grid-rows: 100px;
}
.default-linear-grad {
  background: linear-gradient(#783e9f, #03a9f4);
  -ms-grid-column: 3;
}

.linear-grad-to-top {
  background: linear-gradient(to top, #783e9f, #03a9f4);
  grid-row-start: 1;
}
.linear-grad-70-deg {
  background: linear-gradient(70deg, #783e9f, #03a9f4);
  -ms-grid-column: 5;
}

.row2 {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-template-rows: repeat(2, 100px);
  grid-gap: 1em;

  display: -ms-grid;
  -ms-grid-columns: 100px 1em 100px 1em 100px;
  -ms-grid-rows: 100px 1em 100px;
}

.closest-side {
  background: radial-gradient(closest-side, #783e9f 0, #03a9f4 100%);
  -ms-grid-row: 1;
  -ms-grid-column: 5;
}
.closest-corner {
  background: radial-gradient(closest-corner, #783e9f 0, #03a9f4 100%);
  -ms-grid-row: 3;
  -ms-grid-column: 1;
}
.farthest-side {
  background: radial-gradient(
    farthest-side at 50% 100%,
    #783e9f 0,
    #03a9f4 100%
  );
  -ms-grid-row: 3;
  -ms-grid-column: 3;
}
.farthest-corner {
  background: radial-gradient(farthest-corner at 50% 100%, #783e9f, #03a9f4);
  -ms-grid-row: 3;
  -ms-grid-column: 5;
}
.circle {
  background: radial-gradient(circle, #783e9f 0, #03a9f4 100%);
  grid-row-start: 1;
  -ms-grid-row: 1;
  -ms-grid-column: 1;
}

.ellipse {
  background: radial-gradient(ellipse at 50% 50%, #783e9f 20%, #03a9f4 100%);
  grid-row-start: 1;
  -ms-grid-row: 1;
  -ms-grid-column: 3;
}

              
            
!

JS

              
                // codepen.io/adsingh14
// I hope you've enjoyed this example.
              
            
!
999px

Console