Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Puzzled... Link doesn't work in IE for some reason.
Old 12-23-2008, 08:32 AM Puzzled... Link doesn't work in IE for some reason.
Webmaster Talker

Posts: 626
Trades: 0
I'm puzzled on this one. I have an image that is being displayed as the background to a div. Then I have absolutely positioned some links to act as hotspots over top of three sections of the picture.

For some reason IE7 is not creating clickable links. I've set the z-index to 100 but it just isn't working.

Any suggestions please?

http://www.oxygencomputers.com.au
jim.thornton is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-23-2008, 12:00 PM Re: Puzzled... Link doesn't work in IE for some reason.
Decaf's Avatar
Ultra Talker

Posts: 489
Name: Adam
Trades: 0
Last i knew IE didn't support the Z-index, so it lays a clear image over preventing you from "clicking" the link and instead you click the image.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Decaf is offline
Reply With Quote
View Public Profile Visit Decaf's homepage!
 
Old 12-23-2008, 12:19 PM Re: Puzzled... Link doesn't work in IE for some reason.
Webmaster Talker

Posts: 626
Trades: 0
hmm.... I didn't know that.

Any suggestions how I can get around this? I can't use an image map on a background image can I?
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 12-23-2008, 12:30 PM Re: Puzzled... Link doesn't work in IE for some reason.
stoot98's Avatar
Ultra Talker

Posts: 427
Name: Stuart
Location: Glasgow, Scotland
Trades: 0
Why dont you use actual images side by side instead of as a background?
stoot98 is offline
Reply With Quote
View Public Profile
 
Old 12-23-2008, 12:48 PM Re: Puzzled... Link doesn't work in IE for some reason.
serandfae's Avatar
Do the "Evil Nanner" !!!

Posts: 8,936
Name: Tim Daily
Location: Apex, NC, US, Sol 3
Trades: 0
Quote:
Originally Posted by Decaf View Post
Last i knew IE didn't support the Z-index, so it lays a clear image over preventing you from "clicking" the link and instead you click the image.
Since when does IE not support z-index? z-index only works on positioned elements.

Firstly, you don't need to use a span element within your anchors. Secondly, I cannot locate the style rules you placed on these anchors, for the class names you gave them. Lastly, a z-index would not apply, because it's a background image. Doing it the way you are, you would have to define a width and height on your anchors and align the text part accordingly.

tim
__________________
SEO "experts" smell like Big Fish_|_
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

serandfae is offline
Reply With Quote
View Public Profile Visit serandfae's homepage!
 
Old 12-23-2008, 02:13 PM Re: Puzzled... Link doesn't work in IE for some reason.
Webmaster Talker

Posts: 626
Trades: 0
Sorry, I forgot to include the CSS:

Code:
#mainpic a.laptops {
   position: absolute;
   width: 180px;
   height: 154px;
   left: 75px;
   top: 208px;

   z-index: 100;
   text-align: center;
}

#mainpic a.laptops span {
   color: white;
   text-decoration: underline;
   display: block;
   margin-top: 134px;
}

#mainpic a.desktops {
   position: absolute;
   width: 240px;
   height: 202px;
   left: 361px;
   top: 160px;
   z-index: 100;
   text-align: center;
}

#mainpic a.desktops span {
   color: white;
   text-decoration: underline;
   display: block;
   margin-top: 182px;
}

#mainpic a.officeware {
   position: absolute;
   width: 185px;
   height: 130px;
   left: 688px;
   top: 232px;
   z-index: 100;
   text-align: center;
}

#mainpic a.officeware span {
   color: white;
   text-decoration: underline;
   display: block;
   margin-top: 110px;
}
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 12-23-2008, 02:22 PM Re: Puzzled... Link doesn't work in IE for some reason.
serandfae's Avatar
Do the "Evil Nanner" !!!

Posts: 8,936
Name: Tim Daily
Location: Apex, NC, US, Sol 3
Trades: 0
OK, that's why I didn't see it at first. You're putting all that on mainpic, which you're using as a background image. The styles you're applying need to be put directly on the classes you're using. Take the #mainpic off, put those rules on .classname a for each one, and it should work fine.

tim
__________________
SEO "experts" smell like Big Fish_|_
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

serandfae is offline
Reply With Quote
View Public Profile Visit serandfae's homepage!
 
Old 12-23-2008, 03:48 PM Re: Puzzled... Link doesn't work in IE for some reason.
Webmaster Talker

Posts: 626
Trades: 0
I've just deduced it to the #mainpic property position: relative;

For some reason it is causing the links within the DIV in IE to now work at all.
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 12-23-2008, 03:50 PM Re: Puzzled... Link doesn't work in IE for some reason.
Webmaster Talker

Posts: 626
Trades: 0
Quote:
Originally Posted by serandfae View Post
OK, that's why I didn't see it at first. You're putting all that on mainpic, which you're using as a background image. The styles you're applying need to be put directly on the classes you're using. Take the #mainpic off, put those rules on .classname a for each one, and it should work fine.

tim
I don't follow... I have the mainpic there positioned as relative because if I position the anchors as absolute and then they will be relative to the container/window. What do you mean by "those classes"... Which ones?
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 12-23-2008, 04:12 PM Re: Puzzled... Link doesn't work in IE for some reason.
serandfae's Avatar
Do the "Evil Nanner" !!!

Posts: 8,936
Name: Tim Daily
Location: Apex, NC, US, Sol 3
Trades: 0
Quote:
Originally Posted by zincoxide View Post
I don't follow... I have the mainpic there positioned as relative because if I position the anchors as absolute and then they will be relative to the container/window. What do you mean by "those classes"... Which ones?
.laptops, .desktops, and .officeware. Put the rules JUST on those, as such because tying them to #mainpic is what's causing those styles not to be recognized.

tim
__________________
SEO "experts" smell like Big Fish_|_
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

serandfae is offline
Reply With Quote
View Public Profile Visit serandfae's homepage!
 
Old 12-23-2008, 05:58 PM Re: Puzzled... Link doesn't work in IE for some reason.
Webmaster Talker

Posts: 626
Trades: 0
Unfortunately, that did not do it. This is now the CSS file and nothing has changed:

Code:
#mainpic {
   position: relative;
   width: 100%;
   height: 368px;
   margin: 0;
   background: url(../images/bg-home.jpg) no-repeat left top;
}

a.laptops {
   position: absolute;
   width: 180px;
   height: 154px;
   left: 75px;
   top: 208px;

   z-index: 100;
   text-align: center;
}

a.laptops span {
   color: white;
   text-decoration: underline;
   display: block;
   margin-top: 134px;
}

a.desktops {
   position: absolute;
   width: 240px;
   height: 202px;
   left: 361px;
   top: 160px;
   z-index: 100;
   text-align: center;
}

a.desktops span {
   color: white;
   text-decoration: underline;
   display: block;
   margin-top: 182px;
}

a.officeware {
   position: absolute;
   width: 185px;
   height: 130px;
   left: 688px;
   top: 232px;
   z-index: 100;
   text-align: center;
}

a.officeware span {
   color: white;
   text-decoration: underline;
   display: block;
   margin-top: 110px;
}
Here is a link to the complete css file.
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 12-24-2008, 12:32 AM Re: Puzzled... Link doesn't work in IE for some reason.
serandfae's Avatar
Do the "Evil Nanner" !!!

Posts: 8,936
Name: Tim Daily
Location: Apex, NC, US, Sol 3
Trades: 0
You left the span element within the anchors, which is unnecessary and may be part of your woes. Beyond that, I'm drawing a blank. Also, though it's unrelated, you have an extra </script> on the page.

Edit: I took the span elements out, then put this in conditional comments just for IE, that at least got the links clickable. I'll tinker with it some to see if I can get it to click anywhere.

Code:
.laptops{
   position: absolute;
   width: 180px;
   height: 154px;
   left: 75px;
   top: 208px;

   z-index: 10000;
   text-align: center;
     background:transparent;
}

.laptops{
   color: white;
   text-decoration: underline;
   display: block;
   margin-top: 134px;
}

.desktops{
   position: absolute;
   width: 240px;
   height: 202px;
   left: 361px;
   top: 160px;
   z-index: 100;
   text-align: center;
     background:transparent;
}

.desktops{
   color: white;
   text-decoration: underline;
   display: block;
   margin-top: 182px;
}

.officeware{
   position: absolute;
   width: 185px;
   height: 130px;
   left: 688px;
   top: 232px;
   z-index: 100;
   text-align: center;
     background:transparent;
}

.officeware{
   color: white;
   text-decoration: underline;
   display: block;
   margin-top: 110px;
}
tim
__________________
SEO "experts" smell like Big Fish_|_
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Last edited by serandfae; 12-24-2008 at 01:06 AM..
serandfae is offline
Reply With Quote
View Public Profile Visit serandfae's homepage!
 
Old 12-24-2008, 11:35 AM Re: Puzzled... Link doesn't work in IE for some reason.
Webmaster Talker

Posts: 626
Trades: 0
I removed the span elements as you suggested but that didn't work.

If I remove the position: relative from the #mainpic the links become clickable.

The span elements are there to position the words to the bottom center of the anchors.
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 12-24-2008, 12:05 PM Re: Puzzled... Link doesn't work in IE for some reason.
serandfae's Avatar
Do the "Evil Nanner" !!!

Posts: 8,936
Name: Tim Daily
Location: Apex, NC, US, Sol 3
Trades: 0
They stayed in that position even without the span. But there's got to be a better way of doing it without all that positioning. I'll keep tinkering with it, but at this point it will be after tomorrow.

tim
__________________
SEO "experts" smell like Big Fish_|_
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

serandfae is offline
Reply With Quote
View Public Profile Visit serandfae's homepage!
 
Old 12-24-2008, 05:28 PM Re: Puzzled... Link doesn't work in IE for some reason.
Webmaster Talker

Posts: 626
Trades: 0
No problem... Thank you so much for your help.

I figured the best way (for all monitor sizes) was to do it with the positioning.

I removed the span tags and the text jumped up to the top of the anchors.
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 12-25-2008, 08:16 PM Re: Puzzled... Link doesn't work in IE for some reason.
serandfae's Avatar
Do the "Evil Nanner" !!!

Posts: 8,936
Name: Tim Daily
Location: Apex, NC, US, Sol 3
Trades: 0
Got it! Here are the relevant changes to the HTML:

HTML Code:
<div id="mainpic">
<a href="http://www.oxygencomputers.com.au/index.php?option=com_virtuemart&amp;page=shop.browse&amp;category_id=2&amp;Itemid=9" class="laptops"><span>Laptops</span></a>
<a href="http://www.oxygencomputers.com.au/index.php?option=com_virtuemart&amp;page=shop.browse&amp;category_id=1&amp;Itemid=9" class="desktops"><span>Desktops</span></a>
<a href="http://www.oxygencomputers.com.au/index.php?option=com_virtuemart&amp;page=shop.browse&amp;category_id=3&amp;Itemid=9" class="officeware"><span>Officeware</span></a>
</div>
<br class="brclear" />
And the CSS:

Code:
#mainpic {
   width: 100%;
   height: 368px;
   margin: 0;
   background: url(http://www.oxygencomputers.com.au/templates/o2custom/images/bg-home.jpg) no-repeat left top;
}

.laptops{
   float: left;
   width: 300px;
     height:154px;
   margin-top:166px;
   text-align: center;
     text-decoration:none;
   color: white;
   display: block;
     vertical-align: baseline;
}

.desktops{
   float: left;
   width: 320px;
     height:202px;
   margin-top:118px;
   text-align: center;
     text-decoration:none;
   color: white;
   display: block;
     vertical-align: baseline;
}

.officeware{
   float: left;
   width: 320px;
     height:130px;
   margin-top:190px;
   text-align: center;
     text-decoration:none;
   color: white;
   display: block;
     vertical-align: baseline;
}

.laptops span{
        position:relative;
        top:170px;
        text-decoration: underline;
}

.desktops span{
        position:relative;
        top:220px;
        text-decoration: underline;
}

.officeware span{
        position:relative;
        top:150px;
        text-decoration: underline;
}

.brclear{
    clear:both;
    margin:0;
    padding:0;
    line-height:0;
}
Merry Christmas!

tim
__________________
SEO "experts" smell like Big Fish_|_
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

serandfae is offline
Reply With Quote
View Public Profile Visit serandfae's homepage!
 
Old 12-26-2008, 02:31 AM Re: Puzzled... Link doesn't work in IE for some reason.
Webmaster Talker

Posts: 626
Trades: 0
Thank you so much! Again!

That works great. Now there is only one other problem with this page. In my efforts to fix the problem, IE6 is now not displaying any of the header menus as in FF.

Any suggestions?
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 12-26-2008, 11:42 PM Re: Puzzled... Link doesn't work in IE for some reason.
serandfae's Avatar
Do the "Evil Nanner" !!!

Posts: 8,936
Name: Tim Daily
Location: Apex, NC, US, Sol 3
Trades: 0
My first guess would be the absolute positioning, which IE6 is especially quirky with. My suggestion is to take a VERY close look at your div structure, simplify your use of IDs and classes, and use floats and clears to position your elements, using positioning only when necessary, much like I did with the preceding bit of code.

tim
__________________
SEO "experts" smell like Big Fish_|_
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

serandfae is offline
Reply With Quote
View Public Profile Visit serandfae's homepage!
 
Reply     « Reply to Puzzled... Link doesn't work in IE for some reason.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.57697 seconds with 12 queries