Hello, I want to create link with images inside div having absolute position. But link is not being generated. How can I apply link to that div? here is my code. <div style="position: absolute;padding-top:100px;padding-left:50px;"> <a href="http://www.example.com"><img src='path-to-image'></a> </div> Code (markup): Please help me. Thanks in advance.
What browser are you using? It works fine in Firefox, IE8, Chrome, Opera, and Safari. It would help if we could see the rest of the page markup.
Try this: <div style="position: absolute;top:100px;left:50px;"> <a href="http://www.example.com"><img src='path-to-image'></a> </div>
You are applying the link to the image. I agree with Cash. We would really need to see the rest of the markup in order to help.
Sorry, here is the reply: Remove padding add top and left position instead. Here is the code: <div style="position: absolute;top:100px;left:50px;"> <a href="http://www.example.com"><img src='path-to-image'></a> </div> Also make sure that you don't have position:relative defined in any of the outer wraper. Other wise you'll have to set the value of top and left according to the position of the wrapper. Hope this helps.