Hi webmasters, I am trying to make an external link with my div tag as below with java: <div id="mydive" onclick="location.href=mylink;" style="cursorointer;"> </div> the above link is opening internal but I want to make it open in new windows as an external. how this would be possible? would be appreciated if you can show it here visualy . Thanks for any help.
Thanks for your comment. I did as below but did not work ,am I doing wrong something here: <div id=window.open"rightbot2" onclick="location.href='http://yahoo.com';" style="cursorointer;"> Thanks
Why not just use a DIV tag, put an anchor in there, set the height and width of the anchor and DIV to be the same, and declare the anchor's display state as block? No need to use JavaScript then.
Hi ,Dan , this seems good but I am completly newbie at this things . could you please show me the code here . Thank you.
Sure can. <!-- quick and dirty demo; make sure the actual styles are in an external stylesheet and an ID is used on the DIV for the CSS to reference --> <div style="height: 480px; width: "640px;"> <a href="#" style="background-color: pink; display: block; height: 480px; width: 640px;">Link Text</a> </div> Code (markup):
Dan , I know this is going to work but I am mess up with the code when inserting into it. the actual code for the css that I have is as below and It is show a background image in the div tag: #rightbot2{ background:url(images/rightbot2.jpg) no-repeat center; height: 218px; color:#FFFFFF; padding-top: 30px; padding-left: 50px; padding-right: 20px; could you please show it with the above code . many thanks.