123

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <html>
<head>
<style>
  body {
    /*
    * Задаём поля странице в 6%
    */
    padding: 3% 6%;
  }
  
  /*
  * @media — медиа-запрос,
  * screen and (...) — условие,
  * при котором стили внутри
  * медиа-запроса начнуть работать.
  *
  * В данном случае у body
  * поменяются поля, когда ширина
  * окна станет меньше 768 пикселей.
  */
  @media screen and (max-width: 768px) {
    body {
      padding: 1% 2%;
    }
  }
  
  .row {
    /*
    * .row — флекс-контейнер, этаж портфолио.
    */
    display: flex;
    margin-bottom: 20px;
  }
  
  @media screen and (max-width: 768px) {
    .row {
      /*
      * На узких экранах переносим
      * не поместившиеся карточки
      * на следующую строку.
      */
      flex-wrap: wrap;
      margin-bottom: 0;
    }
  }

  .project {
    /*
    * .project — флекс-элемент,
    * карточка проекта.
    * Будет занимать в два раза
    * больше места, чем описание проекта.
    */
    flex: 2;
    padding-right: 10px;
  }

  .project-caption {
    /*
    * .project-caption — описание проекта.
    */
    flex: 1;
    padding-right: 10px;
  }

  .project:last-child,
  .project-caption:last-child {
    /*
    * У последней подписи или проекта
    * убираем правый отступ.
    */
    padding-right: 0;
  }
  
  /*
  * На узких экранах растягиваем
  * проекты и подписи на всю ширину
  * окна и перенастраиваем отступы.
  */
  @media screen and (max-width: 768px) {
    .project,
    .project-caption {
      min-width: 100%;
      padding: 0;
      margin-bottom: 15px;
    }
    
    /*
    * Перемещаем подпись наверх.
    */
    .project-caption:last-child {
      order: -1;
      margin-bottom: 10px;
    }
  }
</style>
  
<style>
  body {
    font-family: Georgia, serif;
    font-size: 20px;
    line-height: 27px;
  }

  h3 {
    font-family: Helvetica Neue, Arial, sans-serif;
    font-weight: bold;
    font-size: 20px;
    line-height: 27px;
    margin: 0 0 .05em 0;
  }

  p {
    margin: 0 0 .88em 0;
  }

  img {
    display: block;
    max-width: 100%;
    height: auto;
  }
  
  .project-caption {
    font-size: 16px;
    line-height: 22px;
  }
  
  .project-caption p {
    /*
    * Выравниваем подписи по строчным
    * с изображениями.
    */
    margin-top: -.5em;
  }
</style>  
</head>
<body>
  <div class="row">
    <div class="project">
      <div class="project-image">
        <img
          src="https://unsplash.it/1000/500"
          width="1000"
          height="500">
      </div>
    </div>
  </div>
  <div class="row">
    <div class="project">
      <div class="project-image">
        <img
          src="https://unsplash.it/800/800"
          width="800"
          height="800">
      </div>
    </div>
    
    <div class="project">
      <div class="project-image">
        <img
          src="https://unsplash.it/850/850"
           width="850"
           height="850">
      </div>
    </div>
    
    <div class="project-caption">
      <p>Практическое руководство для менеджеров и стартаперов</p>
    </div>
  </div>
</body>
</html>
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console