treeleaf20 Posted October 28, 2009 Share Posted October 28, 2009 Maybe this is an easy question: I have the following CSS: .fn-area:hover { position: absolute; background-image: url(artwork/image.gif); border: 1px solid #fff; } The area is different sizes however. Is there anyway to make the image in the background adjust to the size of the area when I hover over it? I don't want the image to repeat if the area is bigger then the image and I don't want only part of the image to appear if it's smaller then the image. Link to comment https://forums.phpfreaks.com/topic/179397-image-size-dependent-on-area/ Share on other sites More sharing options...
haku Posted October 28, 2009 Share Posted October 28, 2009 Set these: background-repeat:no-repeat; min-height:___px; min-width:___px; Link to comment https://forums.phpfreaks.com/topic/179397-image-size-dependent-on-area/#findComment-946687 Share on other sites More sharing options...
treeleaf20 Posted October 29, 2009 Author Share Posted October 29, 2009 What do you mean by min height or min width? What happens if I hve two diferrent things. One is 100x75 and another one is 425x50? These are both def possible scenarios and both on the same page. Link to comment https://forums.phpfreaks.com/topic/179397-image-size-dependent-on-area/#findComment-946707 Share on other sites More sharing options...
treeleaf20 Posted October 29, 2009 Author Share Posted October 29, 2009 Actually, it's always in the shape of a rectangle. So it would have more dimensions then that but it should give you an idea of my problem. Link to comment https://forums.phpfreaks.com/topic/179397-image-size-dependent-on-area/#findComment-946709 Share on other sites More sharing options...
haku Posted October 29, 2009 Share Posted October 29, 2009 So set the size separately for each div. Link to comment https://forums.phpfreaks.com/topic/179397-image-size-dependent-on-area/#findComment-947060 Share on other sites More sharing options...
nadeemshafi9 Posted October 29, 2009 Share Posted October 29, 2009 So set the size separately for each div. are your _ scores theoretical wildcards or code? Link to comment https://forums.phpfreaks.com/topic/179397-image-size-dependent-on-area/#findComment-947068 Share on other sites More sharing options...
treeleaf20 Posted October 29, 2009 Author Share Posted October 29, 2009 I'm guessing they are theoretical wildcards. Not sure how to set the size differently for each div? Link to comment https://forums.phpfreaks.com/topic/179397-image-size-dependent-on-area/#findComment-947075 Share on other sites More sharing options...
haku Posted October 30, 2009 Share Posted October 30, 2009 Give each div an ID and target that ID with your CSS. Link to comment https://forums.phpfreaks.com/topic/179397-image-size-dependent-on-area/#findComment-947546 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.