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="vertical-wrap">
<h2 class="title">梶井基次郎<span>檸 檬</span></h2>
<p class="copy">&emsp;見わたすと、その檸檬の色彩はガチャガチャした色の階調をひっそりと紡錘形の身体の中へ吸収してしまって、カーンと冴えかえっていた。私は埃ほこりっぽい丸善の中の空気が、その檸檬の周囲だけ変に緊張しているような気がした。私はしばらくそれを眺めていた。<br>&emsp;不意に第二のアイディアが起こった。その奇妙なたくらみはむしろ私をぎょっとさせた。</p>
</div>

              
            
!

CSS

              
                .vertical-wrap {
    padding: 10vw;
    height: 300px;
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    max-width: 800px;
    margin: auto;
}
.title {
  font-size: 1.6rem;
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
  position: relative;
  padding-right:  12px;
  & span {
    display: block;
    font-size: 2.6rem;
    line-height: 1.0;
    margin-right: 10px;
  }
  &::after {
    content: "KAJII MOTOJIROU";
    position: absolute;
    top: 0;
    right: 0;
    font-family: 'Playfair Display', serif;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
  }
}
.copy {
  font-size: 1.0rem;
  writing-mode: vertical-rl;
  line-height: 50px;
  background-image: linear-gradient(90deg, #ccc 0, #ccc 1px, transparent 1px);
  background-position: top left;
  background-size: 50px auto;
  background-repeat: repeat;
  border-right: 1px solid #ccc;
}
//768px以下の横書きテキストの設定
@media screen and (max-width: 768px) {
.vertical-wrap {
  padding: 10vw 5vw;
  height: auto;
}
.copy {
  width: 70%;
  font-size: 0.8rem;
  writing-mode: horizontal-tb;
  background-image: linear-gradient(180deg, #ccc 0, #ccc 1px, transparent 1px);
  background-position: top left;
  background-size: auto 50px;
  border-right: none;
  border-bottom: 1px solid #ccc;
}
}

//992px以下の見出しテキスト
@media screen and (max-width: 992px) {
.title {
  font-size: 1.2rem;
  padding-right:  12px;
  & span {
    font-size: 1.8rem;
    margin-right: 4px;
  }
}
}
@media screen and (max-width: 480px) {
.title {
  font-size: 1.0rem;
  &::after {
    font-size: 10px;
  }
  & span {
    font-size: 1.4rem;
  }
  }
}
/*------------------------*/
/*------------------------*/
/*------- BASE -------*/
body {
  font-family: "游明朝", "YuMincho", "ヒラギノ明朝 ProN W3", "Hiragino Mincho ProN", "HG明朝E", "MS P明朝", "MS 明朝", serif;
  font-size: 16px;
  color: #333;
}
h1, h2, h3, h4, h5, h6, p, ul, li {
  margin:0;
  font-weight: normal;
}
p img {
  max-width: 100%;
  margin-bottom: 10px;
}
@import url(https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600&display=swap);
              
            
!

JS

              
                
              
            
!
999px

Console