Sir l33tname
Sir l33tname

Reputation: 4330

CSS grid centered

I try to make my site a bit more responsive.

Basically I have a container html element with multiple block elements inside. The block elements inside are fixed size.

What I try to achieve is that my content is always centred.

I tried something like this:

.container {
    width: 100%;
    margin: 0 auto;
}

I think, I'm not the only one with this problem but I failed to name this problem or find a solution.

example: http://jsfiddle.net/k7u9e/

Upvotes: 0

Views: 74

Answers (2)

Clawish
Clawish

Reputation: 2964

try

.images {
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

http://jsfiddle.net/k7u9e/1/

Upvotes: 1

AlieN
AlieN

Reputation: 543

.container {
    margin: auto;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

Try this

Upvotes: 1

Related Questions