Hiya Guys, How do I adapt the following code, so the ButPrevEna div becomes a link like href? echo '<div id="ButPrevEna">'; echo "<a href=\"./Display.php?id=" . ($start - $perpage) . "\" class=\"NavEna\">Previous Screen</a>"; echo '</div>'; Code (markup): Many Thanks, in advance! Salchester. The Future Is Here - Are You Ready?
Do you mean this? echo '<a href="./Display.php?id='.($start - $perpage).'" class="NavEna"><div id="ButPrevEna">Previous Screen</div></a>'; Code (markup):
<div onclick="openURL('www.microsoft.com')">Hello World, I'm clickable</div> <script language="javascript> function openURL(url){ window.location = url; } </script> Style your div as desired.
You can also do this which normally works well and doesn't require javascript. Style the a tag exactly like you would with the division itself using display:block. Use css to make the link look however you want it. You can set height and width. I prefer to use padding because it will be clickable anywhere. <style type="text/css"> a.NavEna { display:block; width:100%; padding: 10px 0; margin:5px; color:#333; background:#eee; } </style> <?php echo "<a href=\"./Display.php?id=" . ($start - $perpage) . "\" class=\"NavEna\">Previous Screen</a>"; ?> Code (markup):