Jason Schayer
Jason Schayer

Reputation: 171

Resize background(img) without cropping it

I called a background image in css to make an image map. The way I've done so seems to have made difficult to resize without it cropping from the origin point. Here is my current css for calling the image.

ul#LittleItaly {
list-style: none;
background: url(images/Littleitaly_Map.jpg) no-repeat 0 0;
position: relative;
width: 1200px;
height: 1600px;
margin: 0;
padding: 0;
}

When I change the width or height it cuts off parts of the image. Similar to Photoshop changing canvas size.

Upvotes: 0

Views: 62

Answers (1)

Martin Larocque
Martin Larocque

Reputation: 190

background-size:cover

it should do the trick

Upvotes: 2

Related Questions