Jump to content

[SOLVED] div spacing


papillonstudios

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/165536-solved-div-spacing/
Share on other sites

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)}

Link to comment
https://forums.phpfreaks.com/topic/165536-solved-div-spacing/#findComment-873285
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.