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="polite-card">
        <img src="https://i.kym-cdn.com/entries/icons/original/000/026/638/cat.jpg" />
        <div class="css-card">
          <h3>The Polite Cat</h3>
          <p>
            My face when someone expects me to be excited about something that
            I'm not excited about.
          </p>
          <a
            href="https://knowyourmeme.com/memes/polite-cat"
            class="btn"
            target="_blank"
            >Learn more</a
          >
        </div>
      </div>

<!-- Credit -->
<a class="credit" href="https://www.iamsajid.com/">Sajid</a>
              
            
!

CSS

              
                /* Colors & fonts variables */
/* You just have to look at the Actual code */

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap");
:root{
  --ff: "Montserrat", sans-serif;
  --colorp: #f9f9f9;
  --colorp2: #fff;
  --colora: #ffe537;
  --colora2: #537fe7;
  --colorbody: #1e1e1e;
  --colors: #333;
  --h1: bold 54px/60px var(--ff);
  --h2: bold 36px/48px var(--ff);
  --h3: bold 24px/36px var(--ff);
  --links: 18px/18px var(--ff);
  --p: 18px/30px var(--ff);
  --p1: 24px/30px var(--ff);
  --p2: 36px/48px var(--ff);
  --subtext: 12px/20px var(--ff);
  --transition: 0.3s ease-in-out;
}
body {
  width: 90%;
  margin: 20px auto;
  max-width: 1080px;
  background-color: var(--colorbody);
  color: var(--colorp);
}
h1 {font: var(--h1);} h2 {font: var(--h2);} h3 {font: var(--h3);} p {font: var(--p);}



/* Actual code */
h3{margin: 0px;}
.polite-card {
  margin-top: 20px;
  max-width: min(90vw, 400px);
  display: flex;
  flex-direction: column;
  background: var(--colors);
  border-radius: 8px;
  overflow: hidden;
}
/* text & button */
.css-card {
  padding: 20px;
}
.polite-card img {
  border-radius: 0px;
  max-width: 600px;
}

.btn{
  display: inline-block;
  text-decoration: none;
  display: inline-block;
  font: var(--p);
  color: var(--colorp);
  background: linear-gradient(var(--colorbody), var(--colorbody)) padding-box,
    linear-gradient(45deg, var(--colora) 0%, var(--colora2) 100%) border-box;
  border: solid 2px transparent;
  border-radius: 8px;
  padding: 12px 24px;
  transition: 0.2s ease-in-out;
  text-align: center;
  margin-top: 8px;
  
}











/* Credit */
.credit {
  text-decoration: none;
  position: fixed;
  bottom: 20px;
  right: 5vw;
  background: var(--colors);
  padding: 4px 20px;
  border-radius: 4px;
  font: var(--p);
  color: var(--colorp);
}

.credit:hover {
  color: var(--colora);
  transition: var(--transition);
}
              
            
!

JS

              
                
              
            
!
999px

Console