WeLoveCSS Logo
Home Profile Members Search Rules Help New Posts



WeLoveCSS > WEB DESIGN > CSS > [SOLVED] CSS Hotspot on Centered Image

Reply
  Thread Tools Display Modes
Old 23rd July 12, 07:02 PM   #1
HuhWhat
WLC Member
 
Join Date: Jul 2012
Posts: 2
Default CSS Hotspot on Centered Image

Hi, I've set up the following CSS for hotspots on a banner image:

This div takes up the entire width of the page. It contains the background image, and wraps the banner div.:
.banner-wrap {
width:100%;
height:388px;
float:left;
position:relative;
background-repeat: repeat-x;
background-image: url(images/banner-bground.jpg);
}

This div is 970px and is centered in in the banner-wrap. It contains the image, and wraps the hotspot:
.banner {
height:388px;
background-image: url(images/banner.jpg);
background-repeat: no-repeat;
background-position: center top;
}

This is the hotspot div. that contains the position and size specs for the hotspot. It wraps the hotspot links:
.banner .hotspot {
width: 90px;
height: 90px;
position: absolute;
top: 30px;
left: 30px;
}

so, here is the structure code:

<div class="banner-wrap">
<div class="banner">
<a href="x.html" class="hotspot">
</div>
</div>


What I want to do is have the hotspot follow the banner image as it "moves" when the browser window resizes.

I've tried the following to no avail:

(1) Set the .banner class to a fixed width of 970px. This actually uncentered the banner image somehow.

(2) Set .banner .hotspot positioning to percentages instead of fixed coordinates. Made no difference.

(3) set .banner .hotspot position to relative. No effect

3. Can anyone tell me what I should do?

Thanks a bunch,
MIke

Last edited by HuhWhat; 23rd July 12 at 07:45 PM.
HuhWhat is offline   Reply With Quote
Old 31st July 12, 01:27 AM   #2
meesa
WLC Mod
 
meesa's Avatar
 
Join Date: Jul 2009
Location: Milky Way Galaxy
Posts: 3,134
Default Re: CSS Hotspot on Centered Image

How is it not following it?
__________________
Praise be to the Lord God for the ability to learn, the capability to analyze, and the time to help users on this forum.
meesa is online now   Reply With Quote
Old 31st July 12, 02:47 AM   #3
HuhWhat
WLC Member
 
Join Date: Jul 2012
Posts: 2
Default Re: CSS Hotspot on Centered Image

Hi, thank you for replying; I have already resolved this issue.
HuhWhat is offline   Reply With Quote
Reply


Thread Tools
Display Modes
Linear Mode Linear Mode

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:53 AM.



Home | Advertise | Contact Us | Top
Home | Advertise | Contact Us | Top

Copyright© 2006 WeLoveCSS.com. All Rights Reserved.
Powered by vBulletin Version 3.8.4 Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.