- This topic is empty.
January 27, 2015 at 12:57 pm #194367
I’m trying to center these four
divs in a parent
divbut without results.
margin: 0 autousually does the job with
blockelements, but now I really need you
divs to stay on one line!
I wouldn’t want to post all the code here, but take a look at the site.
How can I center all these
divs inside another
div?January 27, 2015 at 1:26 pm #194370
Inline block divs can be centered by applying text-align:center to their parent.January 27, 2015 at 2:38 pm #194374SenffParticipant
Looks like the link in your original post is wrong (points to a generic page of a UK hosting company). Please check and try again.January 28, 2015 at 10:53 am #194512
Well looks like I can’t edit my post.
But here’s the link: http://foxcenter.url.ph/kuntosali/blogi/January 28, 2015 at 11:30 am #194528
Did you fix this?…the portrait blocks look centered to me…or is it something else?January 30, 2015 at 11:53 am #194720
Yep. Thanks to your “inline-block” advice.
But now how could I center the inline-blocks vertically as well?January 30, 2015 at 1:17 pm #194724
But now how could I center the inline-blocks vertically as well?
Well, basically, you can’t.
What you can do is wrap those elements in div and vertically center that.
Instead of vague ‘can you’ questions, perhaps you could provide a reduced case demo in Codepen of your existing HTML & CSS and we can go from there.
Also, if you have a design image of the finished article that would help.
- The forum ‘CSS’ is closed to new topics and replies.