Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Do something with a div in a div when hovering over the div

Featured Replies

I think you'll understand me a bit, but what I'm trying to do is when hovering over a div called ServerField, it has to display ServerDesc using display: none and display: block or something. I did it before but I forgot it, I have no idea why. :/

 

echo '<div id ="Serverlist">';
echo '<table>';
     echo '<tr id="ListInfo">';
          echo '<td id></td>';
          echo '<td>' . $Translations[$Language]["LIST"][1] . '</td>';
          echo '<td>' . $Translations[$Language]["LIST"][2] . '</td>';
          echo '<td>' . $Translations[$Language]["LIST"][3] . '</td>';
          echo '<td>' . $Translations[$Language]["LIST"][4] . '</td>';
		echo '<td colspan="2">' . $Translations[$Language]["LIST"][5] . '</td>';
          echo '<td>' . $Translations[$Language]["LIST"][6] . '</td>';
     echo '</tr>';
     for($i=0;$i<count($Names);$i++) {
		echo '<div id="ServerField">';

			echo '<tr id="ServerInfo">';
				echo '<td>' . ($i+1) . '</td>';
				echo '<td>' . $ServerList["Names"][$i] . '</td>';
				echo '<td>' . $ServerList["Descriptions"][$i] . '</td>';
				echo '<td>' . $ServerList["IPs"][$i] . '</td>';
				echo '<td>' . $ServerList["Accounts"][$i] . '</td>';
				echo '<td>' . $ServerList["Votes"][$i] . '</td>';
				echo '<td><a href="index.php?s=vote&id=' . $ServerList["IDs"][$i] . '">' . $Translations[$Language]["LIST"][7] . '</a>';
				echo '<td>' . date("d.m.y - H:i",$ServerList["Dates"][$i]) . '</td>';
			echo '</tr>';

			echo '<tr>';
				echo '<td colspan="100">';
					echo '<div id="ServerDesc">';
						echo 'THIS IS THE DESCRIPTION!';
					echo '</div>';
				echo '</td>';
			echo '</tr>';

		echo '</div>';
	}
echo '</table>';
echo '</div>';

If #ServerDesc is a child of #ServerField its pretty easy:

 

#ServerDesc
{
display:none;
}
#ServerField:hover #ServerDesc
{
display:block;
}

Edited by Leonvv

  • Author

If #ServerDesc is a child of #ServerField its pretty easy:

 

#ServerDesc
{
display:none;
}
#ServerField:hover #ServerDesc
{
display:block;
}

I thought so too but it isn't working. I have some other :hover stuff too but even when I comment them it isn't working.

 

Edit: When I inspect the element ServerDesc it is 0px tall and in the corner of my ServerList, how is this possible?

Edited by Dreeass

I thought so too but it isn't working. I have some other :hover stuff too but even when I comment them it isn't working.

 

Edit: When I inspect the element ServerDesc it is 0px tall and in the corner of my ServerList, how is this possible?

 

Could you post some html code instead of php code ?

That would make it easier to inspect. ;)

  • Author

Could you post some html code instead of php code ?

That would make it easier to inspect. ;)

That should be all the code you need and the variables are just text so there shouldn't be a problem for you.

That should be all the code you need and the variables are just text so there shouldn't be a problem for you.

This is too hard to read as html, sorry.

Maybe you got a link ?

  • Author

Do you have any javascriptthat might be messing it up?

No, I'm not using Javascript.

  • Author

I found the problem, the added row in the table caused it to act weird. I have no idea why but when I put the td in the already existing row it works. Weird.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.