wright67uk Posted May 1, 2011 Share Posted May 1, 2011 Can a background image overflow its container? #banner { height:54px; width:100%; background-color:#36F; background-image:url(i-stevenage.png); background-repeat:no-repeat; background-position:5% 0%; } is it possible to have a background image spill over the top and bottom of #banner? somthing like; background-image:overflow; ??? Link to comment https://forums.phpfreaks.com/topic/235254-can-a-background-image-overflow-its-container/ Share on other sites More sharing options...
cssfreakie Posted May 1, 2011 Share Posted May 1, 2011 Quote Can a background image overflow its container? Nope strictly spoken it can't. But, the padding property, might be what you're looking for. (btw have a look at the css boxmodel) if you give a container a padding of say 50px div#container{ padding:25px; /* shorthand for 25px at each side makes it both horizontally and vertically +50px*/ } the content of that container will not touch the border, but have some space around it. That way you can make the background appear to "overflow". (got a small article on my blog if interested, but there are quite some out there). Hope this helps. Link to comment https://forums.phpfreaks.com/topic/235254-can-a-background-image-overflow-its-container/#findComment-1209034 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.