Jump to content

PHP Textbox Onmouseover (Style Problem?)


sebthib55

Recommended Posts

I created a textbox that appears once you hover over a play button displaying the game's description. I got the text to center, but everything in the textbox seems indented and pushed to the right.

 

textboxpreviewxq2.gif

 

echo"<div id='popup$g[0]' style='position:absolute;border:1px solid #333;background-color:#DDD;color:#000;width=175px;display:none;'>
<ol>
<center>$g[2]</center>
</ol></div><br>";

?>
<a href='Arcade.php?play=<?php echo $g[0] ?>' onmouseover='document.getElementById("popup<?php echo $g[0] ?>").style.display=""' onmouseout="document.getElementById('popup<?php echo $g[0] ?>').style.display='none'" onmousemove="s=document.getElementById('popup<?php echo $g[0] ?>').style;s.top=document.body.scrollTop+event.clientY+2;s.left=document.body.scrollLeft+event.clientX-152;">[PLAY]</a>
<?PHP

Link to comment
https://forums.phpfreaks.com/topic/112510-php-textbox-onmouseover-style-problem/
Share on other sites

If <center>$g[2]</center> is your text that is displayed... that it seems to be a CSS problem...  You're using an <ol> tag to contain the info, and then centering it.  You should just use a <p> tag instead of the OL, and also apply the center to the p tag, not the actual text $g[2].

 

Otherwise, fix the margin & padding on your <ol> tag and that would probably fix it.  Start with margin: 0; padding: 0;.  Hope that helps.

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.