- This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hey.
I’m trying to center these four div
s in a parent div
but without results.
margin: 0 auto
usually does the job with block
elements, but now I really need you div
s 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 inline-block
-level div
s inside another div
?
Inline block divs can be centered by applying text-align:center to their parent.
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.
Well looks like I can’t edit my post.
But here’s the link: http://foxcenter.url.ph/kuntosali/blogi/
Did you fix this?…the portrait blocks look centered to me…or is it something else?
Yep. Thanks to your “inline-block” advice.
But now how could I center the inline-blocks vertically as well?
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.
https://css-tricks.com/centering-in-the-unknown/
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.