0

My HTML is similar to the following example:

<div class="wrapper">
   <div class="wrapper_item">1</div>
   <div class="wrapper_item">2</div>
   <div class="wrapper_item">3</div>
   <div class="wrapper_item">4</div>
   <div class="wrapper_item">5</div>
   <div class="wrapper_item">6</div>
   <div class="wrapper_item">7</div>
</div> 

And I need layout like this:

enter image description here

The height of blocks can be different.
How can I do it with flexbox without other wrappers?

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701

1 Answers1

-2

You can use tables. That will be easy to implement.

<html>
<head>
 <style>
 table{
    width:100px;
    height:100px;
    border:solid 3px black;
    border-collapse: collapse;
 }
 td{
     background:grey;
     border:solid 3px black;
     padding:0px;
 }
 </style>
 </head>
 <body>
  <table>
   <tr>
     <td rowspan="2" colspan="2">1</td>
     <td>2</td>
     <td>3</td>
    </td>
    <tr>
      <td>4</td>
      <td>5</td>
    </tr>
    <tr>
         <td>6</td>
         <td>7</td>
         <td>8</td>
         <td>9</td>
    </tr>
    </table>
 </body>
</html>

Hope it will help.

Pirate
  • 2,886
  • 4
  • 24
  • 42