Chris Mccabe
Chris Mccabe

Reputation: 1951

div background image

i have a div that is 90x110 how do i restrict the background image i need to use to this size? background image is 120x100?

Upvotes: 0

Views: 175

Answers (2)

mingos
mingos

Reputation: 24552

While the background image will be cropped to the size of your div automatically, in case there's any other content that doesn't stay in, you can always set overflow to hidden in your CSS:

overflow:hidden;

You can also resize your background images, if there's a need. Please have a look at this and this to see how it can be achieved (there are multiple ways).

Oh, you may also want to have a look at a similar SO question posted a few hours ago.

Upvotes: 1

Oded
Oded

Reputation: 499402

The div will not grow larger, the only portion of the background image that will be visible will be a 90x110 rectangle.

Upvotes: 0

Related Questions