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

              
                <body>
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.css"/>
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick-theme.css"/>
  <header class="header">
    <div class="content-wrapper header-nav">
      <h1>XX株式会社</h1>
      <!-- navメニューについては、今回は割愛 -->
      <!-- <nav>
        <ul>
          <li><a href="#">トップページ</a></li>
          <li><a href="#">会社概要</a></li>
          <li><a href="#">事業内容</a></li>
          <li><a href="#">採用情報</a></li>
          <li><a href="#">お問い合わせ</a></li>
        </ul>
      </nav> -->
    </div>
  </header>
  <div class="mainvisual content-wrapper">
    <div class="slider">
      <div><img src="https://images.unsplash.com/photo-1606501126768-b78d4569d3f9?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=870&q=80" alt="" /></div>
      <div><img src="https://images.unsplash.com/photo-1504328345606-18bbc8c9d7d1?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=870&q=80" alt="" /></div>
      <div><img src="https://images.unsplash.com/photo-1598299803204-b73796f43289?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=870&q=80" alt="" /></div>
    </div>
    <h2>ものづくりが好き</h2>
  </div>
  
  
  <script src="https://code.jquery.com/jquery-3.6.1.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js">
  </script>
</body>
              
            
!

CSS

              
                @charset "UTF-8";

body {
  margin: 0;
  padding: 0;
  font-family: "Yu Gothic", "游ゴシック", YuGothic, "游ゴシック体", sans-serif;
  font-weight: 500;
  color: #333;
  line-height: 2.0;
}
h1 {
  font-size: 2rem;
  color: #ffffff;
}
h2,h3,h4,h5 {
  margin: 0;
  padding: 0;
}

img {
  width: 100%;
  vertical-align: bottom;
}

a { 
  text-decoration: none;
  color: #000;
}

a:hover { 
  transition: .3s;
  opacity: 0.6;
}

section {
  margin-bottom: 120px;
}

.content-wrapper {
  max-width: 1400px; /* 画面サイズで可変するように"max-"を追加 */
  padding: 0 20px; /* 左右に余白を作る */
  margin: 0 auto;
}

/* ---------
  header 
------------*/
.header-nav {
  height: 100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* navメニューについては、今回は割愛 */
/* .header nav ul {
  display: flex;
  justify-content: space-between;
  align-items: center;
} */

/* .header nav ul li {
  margin-right: 50px;
} */

/* ---------
  mainvisual 
------------*/
.mainvisual {
  position: relative;
  width: 100%;
  height: 600px;
}

.slider {
  position: relative;
  height: 500px;
  width: 100%;
/*   margin-left: 30%; */
}

.slider img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  margin-left: 30%;
}

.mainvisual h2 {
  position: absolute;
  top: 30%;
  left: 20%;
  background: rgba(255, 255, 255, 0.9);
  font-size: 3rem;
  padding: 1rem;
}

.mainvisual::before {
  position: absolute;
  content: "";
  background: #333;
  height: 700px;
  width: 45%;
  top: -18%;
  left: 0;
  z-index: -1;
}

/* 空タグは使わず、擬似要素で実装 */
/* .bg1 {
  background: #e8e7e7;
  height: 700px;
  width: 45%;
  position: absolute;
  top: -18%;
  left: 0;
  z-index: -1;
} */

.slick-arrow:before{
	content:""!important;
/*   左右の矢印が出てしまうので、強制的に消す */
}
              
            
!

JS

              
                $(function () {
  $(".slider").slick({
    autoplay: true,
    autoplaySpeed: 2000,
    speed: 2000,
    fade: true,
    cssEase: 'linear'
    });
});
              
            
!
999px

Console