Z
Z
zerofx2016-10-15 23:05:41
css
zerofx, 2016-10-15 23:05:41

How can I align a block to the center?

Hi all!
Sorry for the not very interesting question and I didn't find the answer on Google...
The problem is that I don't know how to align the div block to the center, what I read I understand that there is no standard class...
Tell me if there is a way, or how can align block say col-sm-4

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vyacheslav Lebedev, 2016-10-16
@slavikse

Try adding a class to .col-sm-4 with: margin: 0 auto;
Here there are interesting ways
In general, look towards flex

D
Dmitry Evgrafovich, 2016-10-16
@Tantacula

the standard class for this is .center-block and .text-center for centering inline elements within a block. but with col-sm-4 this will only take effect if you put a center-block inside it. Well, the alignment will be relative to the parent, of course. in general, the developer's browser panel to help, it's clearer there what styles are added.

Z
zerofx, 2016-10-16
@zerofx

или я действительно не понимаю или я не так что-то делаю ...
про строчные элементы это я понимаю =) но это немножко не то ..
вот тут пример - https://jsfiddle.net/c0h1L37n/
PS - только растяните блок с рендером .. а то не так все видно в малом фрейме

M
MaxFreedom, 2016-10-16
@RomanticOS

если , то в css нужно прописать: .col-sm-4 col-sm-offset-4{margin: 0px auto;}
или

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question