L
L
Leonid Nimchenko2017-07-11 15:09:02
css
Leonid Nimchenko, 2017-07-11 15:09:02

How to make responsive 5 columns with padding between them?

Hello.
Something stupid. Can you please tell me how to adaptively lay out five equal-width columns with equal indents between them but without indents at the edges?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
axeax, 2017-07-11
@lculver

https://jsfiddle.net/86tgyfwn/

N
Negwereth, 2017-07-11
@Negwereth

F
L
E
X

I
iBird Rose, 2017-07-11
@iiiBird

wrap in a div that needs to be given a minus margin of padding.

.row {margin-left: -15px; margin-right: -15px;}
.col {width: 20%; padding-left: 15px; padding-right: 15px;}

C
chimir, 2017-07-11
@chimir

the easiest way to do this is on flex https://jsfiddle.net/chimir/nx5vnLm5/
if you do it on floats, then use pseudo -classes :first-childand / or :last-childto remove the indent from the extreme elements.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question