S
S
Shrt2016-02-16 17:57:36
css
Shrt, 2016-02-16 17:57:36

How to arrange icons in a row with captions (HTML, CSS)?

Hello! I'm sorry, the question is probably very noob, but I'm a beginner struggling with a problem that seems simple but still.
I want to understand how to place icons or pictures strictly in the middle, in one row, and so that with captions. On one image that I attached, about what I need, on the second, what I get. Thank you very much to everyone who will respond!
956a8620ad184a5aae9383f84f3da899.png6c90760860204f27ab97f16d4379d75e.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
serghost, 2016-02-16
@serghost

How about trendy youth flexbox? (ie10+)
https://jsfiddle.net/327ssbs6/2/
The advantage of flex is that it allows you to center both horizontally and vertically. In addition, the blocks we want to align can be of random size.

D
Damir Aushenov, 2016-02-16
@yespeace

https://jsfiddle.net/arqcvhsa/2/
it is enough to specify text-align: center;

D
Dark Hole, 2016-02-16
@abyrkov

Googling a little, I found such a solution
. But for some reason it doesn’t work out for me (
2 options remain:
if the width is known, then

position: relative;
left: calc(50% - 45px)

Instead of 45px - half the width
if not - javascript only

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question