1

Do you have any idea why IE does not recognize any of these buttons below as a link at all?

<a href="#zanas" class="content-loader"><div id="zanas"></div></a>
<a href="#dizain" class="pics_holders"><div id="dizain"></div></a>
<a href="#izkustvo"><div id="izkustvo"></div></a>
<a href="#kontakti" class="content-loader"><div id="kontakti"></div></a>

also check out the site (the buttons are located on the lamp's shape) - http://lambev-design.com/

Update: I saw that the elements have to contain something (the empty spaces did not work), and knowing that the divs are located in 4 different places rather to create a span tags I chose to simply put an images in those divs with opacity as 0 but i do't know if that is a CrossBrowser command and if will work everywhere).

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Bat Jeko
  • 49
  • 6
  • according to [this fiddle](http://jsfiddle.net/Fttyh/) only IE7 makes problems... see my answer. – Tomas Apr 16 '12 at 16:02

3 Answers3

2

I guess because <a><div></div></a> markup is not valid (well, not only, the second reason is IE itself...). Try to replace the <div>with <span> and add some CSS rules:

a.content-loader span { 
    display: block; 
    position: relative;
    z-index: -1;
}
a.content-loader { display: inline-block; }

This strange fiddling helps to solve the IE7 issue and should be cross-browser valid. See http://jsfiddle.net/Fttyh/3/ which works in IE7 (unlike the original fiddle).

I had very similar problem recenty and I adopted the answer to your problem :-) so refer there for more details.

Community
  • 1
  • 1
Tomas
  • 57,621
  • 49
  • 238
  • 373
  • Thanks for your help you but i can not set 4 differend divs (each of them located in certain place) in one class, you can check out the site. I have also faund a simple decision :), but i don't know if will work... – Bat Jeko Apr 17 '12 at 05:10
0

try adding the id="..." into the a-tag:

<a href="#dizain" class="pics_holders" id="dizain"></a>

dont know if that helps but I think I did it before...

Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276
floxx
  • 9
  • 3
0

A tags doesn't make Divs in IE, as a workaround you could write this:

<a href="#zanas" class="content-loader"><div onclick="window.location.hash='#zanas'" id="zanas"></div></a>
Henrik Karlsson
  • 5,559
  • 4
  • 25
  • 42