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

              
                <!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="style.css">
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link href="https://fonts.googleapis.com/css2?family=Lato:wght@100;400;700&family=Poppins:wght@200&display=swap"
        rel="stylesheet" />
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@200&display=swap" rel="stylesheet" />
    <title>Portfolio</title>
</head>

<body>
    <header>
    
        <div class="container">
            <nav class="flex items-centre justify-between">
                <div class="left flex justfiy-right">
                    <div class="logo"> <img src="https://images.pexels.com/photos/1382731/pexels-photo-1382731.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500" width="50px" alt="logo"> </div>
                    <div> <a href="#">Home</a> <a href="#">About</a> <a href="#">Services</a> <a href="#">Blog</a></li>
                        <a href="#">More</a> </div>
                </div>
                <div class="right"> <button class="btn btn-primary">Contact</button> </div>
            </nav>
        </div>
        <div class="hero flex items-centre justify-between">
            <div class="left flex-1 justify-center">
                <img src="https://images.pexels.com/photos/1382731/pexels-photo-1382731.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500" />
            </div>
            <div class="right flex-1">
                <h6>CODEWITHRANDOM</h6>
                <h1>
                    I'm a Web<br />
                    <span>Developer</span>
                </h1>
                <p>
                    Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloremque
                    illum nam nobis, minima laudantium fugit sequi nostrum quod impedit,
                    beatae necessitatibus praesentium optio labore nemo!
                </p>
                <div><button class="btn btn-secondary">DOWNLOAD CV</button></div>
            </div>
        </div>
    </header>

    <section class="about">
        <div class="container flex items-centre">
            <div class="left flex-1 justify-right">
                <img src="https://images.pexels.com/photos/1382731/pexels-photo-1382731.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500"
                    height="400px" alt="profile pic" />
            </div>
            <div class="right flex-1">
                <h1>About <span>Me</span></h1>
                <h3>Hello! I'm CODEWITHRANDOM.</h3>
                <p>
                    Lorem ipsum dolor sit amet consectetur adipisicing elit. Atque
                    adipisci distinctio obcaecati aliquid, quia tempora quis optio
                    repudiandae officia earum? Lorem ipsum dolor sit amet
                    consectetur, adipisicing elit.
                </p>
                <div class="socials">
                    <a href="#"><img
                            src="https://images.pexels.com/photos/1758144/pexels-photo-1758144.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500"
                            width="40px" /></a>
                    <a href="#"><img
                            src="https://images.pexels.com/photos/1382734/pexels-photo-1382734.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500"
                            width="40px" /></a>
                    <a href="#"><img
                            src="https://images.pexels.com/photos/1462636/pexels-photo-1462636.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500"
                            width="40px" /></a>
                    <a href="#"><img
                            src="https://images.pexels.com/photos/1758144/pexels-photo-1758144.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500"
                            width="40px" /></a>
                </div>
            </div>
        </div>
    </section>
    <section class="services">
        <div class="container">
            <h1 class="services-head">Services</h1>
            <p>All your digital needs... covered.</p>
            <div class="card-grid">
                <div class="card">
                    <img src="https://source.unsplash.com/1600x900/?nature,water" />
                    <h2>Graphic Desgin</h2>
                    <p>
                        Lorem ipsum dolor sit amet consectetur, adipisicing elit.
                        Nulla, debitis?
                    </p>
                </div>
                <div class="card">
                    <img src="https://source.unsplash.com/1600x900/?boy,men" />
                    <h2>Web Development</h2>
                    <p>
                        Lorem ipsum dolor sit amet consectetur, adipisicing elit.
                        Nulla, debitis?
                    </p>
                </div>
                <div class="card">
                    <img src="https://source.unsplash.com/1600x900/?car,bike" />
                    <h2>Content Writing</h2>
                    <p>
                        Lorem ipsum dolor sit amet consectetur, adipisicing elit.
                        Nulla, debitis?
                    </p>
                </div>
            </div>
        </div>
    </section>

</body>

</html>
              
            
!

CSS

              
                :root {
  --primary: rgb(29, 221, 189);
  --bgDark: rgb(12, 12, 12);
  --white: rgb(250, 250, 250);
  --secondary: rgb(0, 59, 50);
  --bgLight: rgb(190, 181, 181);
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}
header {
  background-color: var(--bgDark);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 73% 94%, 0 100%);
}
header nav .left a {
  color: var(--white);
  text-decoration: none;
  margin-right: 2rem;
  text-transform: uppercase;
  transition: all 0.2s ease;
}
header nav .left a:hover {
  color: var(--primary);
}
header nav {
  padding: 2rem 0;
}
header nav .logo {
  margin-right: 3rem;
}

body {
  font-family: "Poppins", sans-serif;
}
.container {
  max-width: 1152px;
  padding: 0 15px;
  margin: 0 auto;
}
.hero {
  padding-top: 2rem;
  padding-bottom: 3rem;
}
.hero .left img {
  width: 400px;
  height: 600px;
  margin: 70px;
}
.hero .right {
  color: var(--white);
  margin-top: -7rem;
}
.hero .right h6 {
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.hero .right h1 {
  font-size: 4rem;
  font-weight: 100;
  line-height: 1.2;
  margin-bottom: 2rem;
}
.hero .right h1 span {
  color: var(--primary);
}
.hero .right p {
  line-height: 1.9;
  margin-bottom: 2rem;
}

section {
  padding: 6rem;
}
section.about h1 {
  margin-bottom: 1rem;
  font-size: 1.6rem;
  font-weight: 600;
}
section.about h1 span {
  color: var(--primary);
}
section.about h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}
section.about p {
  font-family: "Lato", sans-serif;
  color: var(--secondary);
  line-height: 1.9rem;
  margin-bottom: 2rem;
}
section.about .socials {
  display: flex;
}
section.about .socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  margin-right: 0.8rem;
  border-radius: 50%;
}
section.about .socials a:hover {
  background: var(--primary);
}

section.services {
  background: rgb(17, 17, 17);
}
.services-head {
  color: rgb(10, 9, 9);
  text-align: center;
  margin-bottom: 1rem;
  line-height: 0.5rem;
  color: var(--primary);
}
.services-head + p {
  color: var(--white);
  font-family: "Lato", sans-serif;
  margin-bottom: 1rem;
  text-align: center;
  margin-bottom: 6rem;
  font-weight: 400;
}
.card img {
  width: 50px;
  background: white;
}
section.services .card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 2rem;
}
section.services .card-grid .card {
  background: var(--white);
  padding: 3rem 2rem;
  position: relative;
  text-align: center;
  transition: all 0.2s ease;
}
section.services .card-grid .card img {
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: var();
}
section.services .card-grid .card h2 {
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
section.services .card-grid .card p {
  font-family: "Lato", sans-serif;
  color: var(--seconday);
  line-height: 1.6;
}
section.services .card-grid .card:hover {
  background: var(--primary);
}
section.services .card-grid .card:hover h2 {
  color: var(--white);
}
section.services .card-grid .card:hover p {
  color: var(--white);
}

.flex {
  display: flex;
}
.items-centre {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.justify-center {
  justify-content: center;
}
.justify-right {
  justify-content: right;
}
.btn {
  padding: 0.6rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid transparent;
  outline: none;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s ease;
}
.btn-primary {
  background-color: var(--primary);
  color: var(--secondary);
  margin-top: -15rem;
}
.btn-primary:hover {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.flex-1 {
  flex: 1;
}
.btn-secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-secondary:hover {
  background: var(--primary);
  color: var(--secondary);
}

              
            
!

JS

              
                
              
            
!
999px

Console