F
F
freeman02042015-10-13 15:22:14
css
freeman0204, 2015-10-13 15:22:14

Last-child doesn't help. How to remove margin from the last block?

Codepen.io/anon/pen/NGvEQb Last-child doesn't help .
And if you write directly to the class right

.right {
    margin: 0;
}

then nothing will change until I instead
.col {
     width: calc((100%/3) - 30px);
     margin-right: 30px;
    background: green;
    float: left;
}

I won't prescribe
.col {
     width: calc((100%/3) - 30px);
     margin-right: 45px;
    background: green;
    float: left;  
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DenJel, 2015-10-13
@freeman0204

What are you driving?
Maybe that's better?
Well, or if it's really hot, here's your example
!!!!!
and in general it’s time to forget about float, there has long been a property display: flex, which now all browsers are eating if ie8 support is not needed

D
Denis Ineshin, 2015-10-13
@IonDen

And I did it:

.col:last-child {
  margin-right: 0;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question