2

http://codepen.io/anon/pen/LFvlp

HTML

   <div class="entry-content">
  I’m not the only one in the family having a weakness for interiors. I think I received the microbe from my parents. Although our style is different on the first sight, there are still a lot of things we have in common. We both love contemporary design in combination with vintage. Also I have the love for design classics in my veins because of them.

The biggest difference is that the living room is a dark and cozy cave. But the design classics give the space that extra touch. Every time when I look at those, I discover a new detail. That makes this living room a real inspiration for me.


  <div class="post-tags">
    Chair: Hans J. Wegner, coffee table: Eames 
  </div>

</div>

CSS

 .entry-content {
         -webkit-column-count: 2; /* Chrome, Safari, Opera */
         -moz-column-count: 2; /* Firefox */
         column-count: 2;

         -webkit-column-gap: 30px; /* Chrome, Safari, Opera */
         -moz-column-gap: 30px; /* Firefox */
         column-gap: 30px;
     }

.post-tags {
  margin-top: 15px;
}

As you can see in the codepen I have two css columns. Now I want the 'post-tags' div to always be on the same height as the last line of the first alinea. Is that possible?

6
  • Do you mean to say that you need the first div in first column and second div in second column? Commented Nov 2, 2014 at 10:11
  • Why don't you just send post-tags div to the outside? Commented Nov 2, 2014 at 10:12
  • No, I want the second column to be exactly the same height as the first column (or a little bit shorter is also good). Now, as you can see, the second column is a little longer as the first one (mostly when i make my screen smaller) Commented Nov 2, 2014 at 10:13
  • Because it needs to be in the second column Commented Nov 2, 2014 at 10:14
  • Try this Commented Nov 2, 2014 at 10:17

1 Answer 1

1

Insert another element after .post-tags: This forces the renderer to take the margin-top into account when calculating the columns.

HTML: <div class="colfix">0</div> (Can't be empty)

CSS: .colfix{ visibility: hidden; }

Demo: http://codepen.io/anon/pen/Dmwjc

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.