papillonstudios Posted July 10, 2009 Share Posted July 10, 2009 I have a navbar or menu like on this site at the top http://igamix.net and i want my site to do the same thing. heres my current code <?php //Selecting the News From trhe Table news $query = "SELECT * FROM `nav` ORDER BY id"; $result = mysql_query($query); echo'<table>'; echo'<tr>'; echo'<td>'; while($row = mysql_fetch_assoc($result)) { echo '<div class="navbutton">'; echo ''.anchor($row['url'], $row['linkname']).''; echo '</div>'; } echo'</td>'; echo'</tr>'; echo'</table>'; ?> heres my current css .navbutton { width:100px; float:left; } can anyone help me? Quote Link to comment https://forums.phpfreaks.com/topic/165536-solved-div-spacing/ Share on other sites More sharing options...
Hybride Posted July 11, 2009 Share Posted July 11, 2009 Am not sure if that's a different image in the header or not, but either way, they use a and a:hover, with "a" being the base image/colour (white in this case), and a:hover being a different cover as you hover your mouse over the link (I think that's yellow in the example you showed.) Not sure if you're using images, but here's an example of both, first without images: .navbutton a{ color: #fff } .navbutton a:hover{color: #ffff66 /* this is yellow, btw*/} With: .navbutton a{color: #fff; background: url(/link/to/img1.jpg)} .navbutton a:hover{color: #ffff66;background: url(/link/to/img2.jpg)} Quote Link to comment https://forums.phpfreaks.com/topic/165536-solved-div-spacing/#findComment-873285 Share on other sites More sharing options...
papillonstudios Posted July 11, 2009 Author Share Posted July 11, 2009 thanks Quote Link to comment https://forums.phpfreaks.com/topic/165536-solved-div-spacing/#findComment-873352 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.