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

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>
  <body>
    <head>
      <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" integrity="sha512-Fo3rlrZj/k7ujTnHg4CGR2D7kSs0v4LLanw2qksYuRlEzO+tcaEPQogQ0KaoGN26/zrn20ImR1DfuLWnOo7aBA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    </head>
    <section>
      <h1>Carousel</h1>
      
      <div class="carousel-container">
        <i class="fas fa-arrow-left fa-3x"></i>
        
        <div class="image-box">
          <img src="https://i.imgur.com/vRxIGQc.jpg" />
          <img src="https://i.imgur.com/Nb0cKVi.jpg" />
          <img src="https://i.imgur.com/dvEBmwc.jpg" />
          <img src="https://i.imgur.com/z3lXcml.jpg" />
          <img src="https://i.imgur.com/3ozKqnL.jpg" />
        </div>
        
        <i class="fas fa-arrow-right fa-3x"></i>
        
        <ul class="dot-list">
          <li class="dot-item"></li>
          <li class="dot-item"></li>
          <li class="dot-item"></li>
          <li class="dot-item"></li>
          <li class="dot-item"></li>
        </ul>
      </div>
    </section>
  </body>
</html>

              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Pacifico&family=Varela+Round&display=swap');

body {
  background-image: url("./images/bg.jpeg");
  background-repeat: no-repeat;
  background-size: cover;
  font-family: "Varela Round", sans-serif;
}

h1 {
  font-family: "Pacifico", cursive;
  text-align: center;
  font-size: 72px;
}

.carousel-container {
  position: relative;
  width: 650px;
  margin: 0 auto;
  margin-bottom: 100px;
}

.image-box {
  width: 453.17px;
  height: 300px;
  margin: 0 auto;
  overflow: hidden;
  
  display: flex;
}

.image-box > img {
  margin-right: 10px;
}

.carousel-container > i {
  position: absolute;
  top: 50%;
  transform: translate(0, -50%);

  cursor: pointer;
}

.carousel-container > .fa-arrow-left {
  left: 0px;
}

.carousel-container > .fa-arrow-right {
  right: 0px;
}

.dot-list {
  position: absolute;
  left: 50%;
  bottom: -50px;
  transform: translate(-50%);
  
  padding: 0;
  
  display: flex;
  justify-content: center;
}

.dot-item {
  width: 13px;
  height: 13px;
  background-color: black;
  border-radius: 50%;
  list-style: none;
  
  margin: 3px;
  
  cursor: pointer;
}

              
            
!

JS

              
                /*

  다음과 같은 조건을 만족하는 캐로우셀을 완성해주세요!

  📌 좌측 화살표 클릭했을 때 이전 이미지를 보여주세요.
  📌 우측 화살표 클릭했을 때에는 다음 이미지를 보여주세요.
  📌 마지막 이미지에서 우측 화살표를 누를 경우, 첫번째 이미지를 보여주세요.
  📌 첫번째 이미지에서 좌측 화살표를 누를 경우, 마지막 이미지를 보여주세요.
  📌 이미지 하단의 점을 누를 경우, 해당 순번의 이미지를 보여주세요.

*/

console.log("hello, vanilla.");

              
            
!
999px

Console