Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

HTML

              
                <html>
    <head>
        <title>#3 same width and height cards - grid</title>
        <link href="https://fonts.googleapis.com/css2?family=Jua&family=Roboto:wght@300&display=swap" rel="stylesheet"> 
        <link rel="stylesheet" href="./assets/css/main.css">
    </head>
    <body>
        <main>
            <div class="row">
                <div class="card blue">
                    <h1>Headline #1</h1>
                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vulputate est non neque faucibus elementum.</p>
                    <a class="cta" href="#" title="CTA">CTA #1</a>
                </div>
                <div class="card orange">
                    <h1>Headline #2</h1>
                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis sollicitudin sagittis luctus. Duis id lacinia massa. Vestibulum diam purus, tempor.</p>
                    <a class="cta" href="#" title="CTA">CTA #2</a>
                </div>
                <div class="card blue">
                    <h1>Headline #3</h1>
                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis sollicitudin sagittis luctus. Aliquam erat volutpat. Vestibulum diam purus, tempor.</p>
                    <a class="cta" href="#" title="CTA">CTA #3</a>
                </div>
                <div class="card orange">
                    <h1>Headline #4</h1>
                    <p>Lorem ipsum dolor sit amet. Duis sollicitudin sagittis luctus. Aliquam erat volutpat. Duis id lacinia massa. Vestibulum diam purus, tempor.</p>
                    <a class="cta" href="#" title="CTA">CTA #4</a>
                </div>
                <div class="card blue">
                    <h1>Headline #5</h1>
                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vulputate est non neque faucibus elementum.</p>
                    <a class="cta" href="#" title="CTA">CTA #5</a>
                </div>
                <div class="card orange">
                    <h1>Headline #6</h1>
                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis sollicitudin sagittis luctus. Vestibulum diam purus, tempor.</p>
                    <a class="cta" href="#" title="CTA">CTA #6</a>
                </div>
                <div class="card blue">
                    <h1>Headline #7</h1>
                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis sollicitudin sagittis luctus. Aliquam erat volutpat.</p>
                    <a class="cta" href="#" title="CTA">CTA #7</a>
                </div>
                <div class="card orange">
                    <h1>Headline #8</h1>
                    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis sollicitudin sagittis luctus. Aliquam erat volutpat. Duis id lacinia massa. Vestibulum diam purus, tempor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
                    <a class="cta" href="#" title="CTA">CTA #8</a>
                </div>
            </div>
        </main>
    </body>
</html>
              
            
!

CSS

              
                /* layout relevant styles */
html, body
    width: 100%
    height: 100%
    margin: 0

body
    display: flex
    flex-direction: row
    align-items: center

    main
        display: flex
        flex-direction: column
        flex-grow: 1
        align-items: center

    .row
        display: grid
        grid-template-columns: 25% 25% 25% 25%
        grid-auto-rows: 1fr
        margin: 0 25%

.card
    display: flex
    flex-basis: 20%
    flex-grow: 1
  
    p
        flex-grow: 1
    .cta
        align-self: center


/* other styles */      
.card
    flex-direction: column
    padding: 10px
    color: #fff
    border-radius: 20px
    box-sizing: border-box
    margin: 10px
    font-family: Roboto, sans-serif

    &.orange
        background: rgb(251,176,64)
        background: linear-gradient(135deg, rgba(251,176,64,1) 20%, rgba(239,65,54,1) 100%)

    &.blue
        background: rgb(0,174,239)
        background: linear-gradient(135deg, rgba(0,174,239,1) 20%, rgba(45,56,138,1) 100%)



    h1
        margin: 0 
        font-size: 1.2rem
        font-weight: lighter
        text-align: center

    p
        font-size: .8rem

    .cta
        width: 100px
        height: 25px
        border-radius: 13px
        border: 1px solid #fff
        line-height: 25px
        text-align: center
        font-size: .8rem
        color: #fff
        text-decoration: none
        margin-top: 10px
        position: relative
        box-sizing: border-box

        &:hover
            background: #ffffff
            color: #000
            &::after
                right: 5px

        &::after
            content: ">"
            font-family: "Jua"
            position: absolute
            right: 8px
            transition: right 1s ease

a, a:hover
    transition: all 0.3s ease
              
            
!

JS

              
                
              
            
!
999px

Console