Align Repetitive Regions (DIVs) [closed]

-2

I'm having trouble aligning repetitive regions of DreamWeaver .

As you can see, post 4 respected the order and stood next to the third, and the fifth below it. But the ninth post should be below the seventh, stayed next to it below the eighth.

Is there any way to resolve this?

    
asked by anonymous 21.07.2017 / 15:15

1 answer

0

As you did not put any code, I'll give you a solution that should be adjusted by you in your code.

Next:

  • Let's assume that all posts have a class, for this example: post .
  • As we can see, they follow a logic where all odd-numbered posts are on the left and all even-numbered should be on the right.
  • You can use the nth-child selector to achieve the desired effect by adding to your CSS:

    .post:nth-child(odd) {
        clear: both;
    }
    
  • The .post:nth-child(odd) will select everything containing the post odd-number class and will apply the clear: both that will release everything next to it and throw it down. You can also achieve the same effect with a clear: left; that will release only the left.

21.07.2017 / 17:20