Ryan
Ryan

Reputation: 22247

Possible to repeat background image outwards from center?

I'm wondering if this is possible with CSS. I want my background image to begin from an absolute center alignment and tile repeat outwards from there.

Background image to repeat outwards from center

Upvotes: 0

Views: 361

Answers (3)

Roko C. Buljan
Roko C. Buljan

Reputation: 206151

#pattern{
    background: url('pattern.jpg') center center;
    /* other stuff here */
}

Upvotes: 0

Ryan
Ryan

Reputation: 22247

Found the solution:

background-attachment: fixed

See example: http://codepen.io/ryanmclaughlin/pen/3ba02dcabedee91b09cf816d43d148c4

Upvotes: 0

Karim AG
Karim AG

Reputation: 2193

You can use background-position property to center the background and set the repeat value to background, background: url('yourimage') repeat;

Upvotes: 2

Related Questions