Javascript-форум (https://javascript.ru/forum/)
-   (X)HTML/CSS (https://javascript.ru/forum/xhtml-html-css/)
-   -   Как правильно поставить nth of type? (https://javascript.ru/forum/xhtml-html-css/79558-kak-pravilno-postavit-nth-type.html)

ethereal 22.02.2020 03:07

Как правильно поставить nth of type?
 
Здравствуйте! Подскажите как сделать на nth of type такое:


Спасибо!

рони 22.02.2020 09:16

ethereal,
<!DOCTYPE html>
<html>
<head>
  <title>Untitled</title>
  <meta charset="utf-8">
  <style type="text/css">
  body{
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      margin: 0;
  }
  div {
      height:  27vh;
      border: 5px solid #FF8C00;
      background-color: #32CD32;
      width: 60vw;
      margin: 10px;
  }
  div:nth-child(3n + 1), div:nth-child(4n + 1) {
     width: 32vw;
     background-color:  #FF8C00;
  }

  </style>


</head>
<body>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</body>
</html>


Часовой пояс GMT +3, время: 02:56.