javascript - Make image link open in new window in php file -
hi have website has banner want link website of mine, want open in new window. want cursor hand in browsers well. tried target = "_blank" method don't believe right. how can in php?
here code
i know there answers similar question none have solved problem
<div class="banner-part" onclick="location.href='www.blabla.org/' target="_blank";" style="cursor: pointer;" style="cursor: hand;"><img src="<?php bloginfo('url') ?>/images/banner.png" alt="" /></div>
you're making bit of mess there. you're forcing <div>
act <a>
, when achieve same thing sprinkle of css:
<a href="http://www.blabla.org" target="_blank" class="banner-part"> <img src="<?php bloginfo('url') ?>/images/banner.png" alt="" /> </a>
and make <a>
block element through css, without needing put block element (<div>
) inside inline element (<a>
), invalid html in doctypes apart html5 (though browsers won't complain much)
a.banner-part { display:block; }
Comments
Post a Comment