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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.