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="main-visual">
  <div class="text-container">
    <p class="text">古都めぐり</p>
  </div>
</div>
<header>
  <nav>
    <ul>
      <li><a href="#">ホーム</a></li>
      <li><a href="#">観光スポット</a></li>
      <li><a href="#">お土産</a></li>
    </ul>
  </nav>
</header>
<main>
  <section id="top-section">
    <h2>古都の魅力を味わおう</h2>
    <p>日本には、多くの歴史的な建造物や文化財が残されています。そんな古都の魅力を、観光スポットやグルメ、お土産など様々な角度からご紹介します。</p>
  </section>
  <section>
    <h2>観光スポット</h2>
    <ul>
      <li>
        <img src="https://assets.codepen.io/221808/temple-1976543_1280.jpg" width="400" height="300" alt="清水寺" />
        <h3>清水寺</h3>
        <p>清水寺は、京都市東山区にある寺院で、日本を代表する観光スポットの一つです。</p>
        <a href="#">詳細を見る</a>
      </li>
      <li>
        <img src="https://assets.codepen.io/221808/kinkakuji-1581548_1280.jpg" width="400" height="300" alt="金閣寺" />
        <h3>金閣寺</h3>
        <p>金閣寺は、京都市北区にある寺院で、美しい金箔の外観が特徴的です。</p>
        <a href="#">詳細を見る</a>
      </li>
      <li>
        <img src="https://assets.codepen.io/221808/fushimi-inari-shrine-1886975_1280.jpg" width="400" height="300" alt="伏見稲荷神社" />
        <h3>伏見稲荷神社</h3>
        <p>伏見稲荷神社は、京都市伏見区にある神社で、日本全国の稲荷神社の総本社とされています。</p>
        <a href="#">詳細を見る</a>
      </li>
      <li>
        <img src="https://assets.codepen.io/221808/japan-1432866_1280.jpg" width="400" height="300" alt="伏見稲荷神社" />
        <h3>八坂神社</h3>
        <p>八坂神社は、京都市東山にある神社で、祇園祭りが行われることでも知られています。</p>
        <a href="#">詳細を見る</a>
      </li>
    </ul>
  </section>
</main>
<footer>
  ©️ Ancient City Travel
</footer>
              
            
!

CSS

              
                .main-visual {
  height: 100svh;
}

.text-container {
  width: max(200px, 30svw);
  padding: 24px 0;
  container-type: inline-size;
  text-align: center;
}

.text {
  font-size: 20cqw;
  letter-spacing: -1px;
}

/* その他のスタイル */


* {
  box-sizing: border-box;
  
}

body {
  font-family: "游ゴシック Medium", YuGothic, YuGothicM,
    "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: #333;
  line-height: 1.7;
}

.main-visual {
  display: grid;
  color: white;
  background-image: url("https://assets.codepen.io/221808/kyoto_bg.jpg");
  background-position: center;
  background-size: cover;
  place-content: center;
}

.main-visual,
.main-visual * {
  margin: 0;
}
.text-container {
  border-top: 2px solid currentcolor;
  border-bottom: 2px solid currentcolor;
}

.text {
  font-family: "Sawarabi Mincho", serif;
}

/* 以下、下層ページのレイアウト */

/* ヘッダーのスタイル */
header {
  display: flex;
  align-items: center;
  justify-content: right;
  padding: 10px;
  color: #fff;
  background-color: #333;
}

nav ul {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  gap: 16px;
}

nav ul li a {
  font-weight: bold;
  text-decoration: none;
  color: #fff;
}

/* メインセクションのスタイル */
main {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 10px;
}

h2 {
  font-family: "Sawarabi Mincho", serif;
  margin-top: 0;
}

section:not(:first-child) {
  margin-top: 50px;
}

section ul {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 40px;
}

section li {
  width: 100%;
}

section li img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

section li h3 {
  font-family: "Sawarabi Mincho", serif;
  font-size: 1.2rem;
  margin-top: 10px;
  margin-bottom: 0;
}

section li p {
  margin-top: 10px;
}

section li a {
  font-weight: bold;
  display: block;
  margin-top: 10px;
  padding: 10px;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background-color: #333;
}

section li a:hover {
  background-color: #666;
}

footer {
  display: grid;
  place-content: center;
  padding: 12px;
  text-align: center;
}

/* じっくりコトコト古都巡りってかwww */

              
            
!

JS

              
                
              
            
!
999px

Console