millercj Posted March 29, 2008 Share Posted March 29, 2008 Is there a way to make an entire div a hyperlink in XHTML Strict? Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted March 30, 2008 Share Posted March 30, 2008 you could place the entire contents inside an anchor tag - provided that the inner html is permissable... Quote Link to comment Share on other sites More sharing options...
fri3ndly Posted March 31, 2008 Share Posted March 31, 2008 you could place the entire contents inside an anchor tag - provided that the inner html is permissable... That would not be XHTML strict though would it? I tired that before and got an error upon testing. The other way I would use is to set the class for the anchor as: .anchor{ display:block } with the height and width set to the size of the div Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted March 31, 2008 Share Posted March 31, 2008 hence the... provided that the inner html is permissable... at the end of my post.... this is dependant on what tags you place inside the anchor - that is probably where the error was flagged last time... Quote Link to comment Share on other sites More sharing options...
closet_geek Posted April 12, 2008 Share Posted April 12, 2008 Might be totally not what your looking for, but try an onclick. something like <div onclick="document.location.href='http://google.com';">any xhtml</div> Quote Link to comment Share on other sites More sharing options...
sherb Posted April 13, 2008 Share Posted April 13, 2008 just use .div a { display:block; } <div class="div"><a href="link">Link</a></div> This should make the whole div a hyperlink. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.