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>

<head>
  <meta charset="utf-8">
  <title>画像とテキストの横並び</title>
  <link rel="stylesheet" href="https://unpkg.com/ress/dist/ress.min.css">
  <link rel="stylesheet" href="stylesheet.css">
</head>

<body>
  <div class="wrapper">
    <section id="book">
      <h2 class="intro">オススメ書籍紹介</h2>
      <div class="contents">
        <img src="https://drive.google.com/uc?export=view&id=1I-1uR7ReWh4bdwtT1yI7XLSDx7F5dnSv">
        <div class="text">
          <h2>書籍タイトル XXX</h2>
          <ul>
            <li>著者・・・トム</li>
            <li>発行日・・・2021年9月9日</li>
            <li>出版社・・・ABC出版</li>
          </ul>
          <h3>概要</h3>
          <p>あの著名投資家・トムがXX年の人生について赤裸々に語る!投資とは何か、人生とは何か、貴方の脳に語り掛ける一冊!</p>
        </div>
      </div>
  </div>
  </div>
</body>

</html>
              
            
!

CSS

              
                @charset "UTF-8";
* {
  box-sizing: border-box;
}

body {
  font-family: "Meiryo", "sans-serif";
  background-color: white;
}

.wrapper {
  max-width: 768px;
  width: 100%;
  margin: 0 auto;
}

.intro {
  margin-bottom: 20px;
}

.contents {
  display: flex;
  justify-content: space-between;
}

.contents img, .text {
  width: 45%;
}

.text h2, .text h3 {
  padding-bottom: 15px;
  border-bottom: 2px solid #dddddd;
}

.text ul {
  padding: 15px 0;
  list-style-position: inside;
  margin-left: 10px;
}

.text li {
  margin: 5px 0;
}

.text p {
  padding: 15px 0;
  line-height: 32px;
}

@media(max-width: 600px) {
  .wrapper {
    padding: 0 10px;
    margin: 0 auto;
  }
  .contents {
    flex-direction: column;
  }
  .contents img, .text {
    width: 100%;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console