Jump to content

Recommended Posts

I want to display a link to a popup window as text with an underline that responds to the mouse moving over it. I have the link working OK, and looking just like a text link in HTML, but I cannot get the underline to work or show at all. Any ideas?

This is what I have.

<input type="submit" style="text-align:left; border: none; color:#0000FF; text-decoration:underline;" value="Go to new window" onClick="OpenWin1();">

Link to comment
https://forums.phpfreaks.com/topic/229855-display-a-link-as-text/
Share on other sites

try this:

 

<style type="text/css">
.button:hover
{
text-decoration:underline;
/* if above doesnt work try:
border-bottom:1px solid #000;
*/
}
</style>

<input type="submit" style="text-align:left; border: none; color:#0000FF;" class="button" value="Go to new window" onClick="OpenWin1();">

tested this and it works. Remove the border style from the element and add it to the css.

 

<style type="text/css">
.button
{
    border: none;
}

.button:hover
{
border-bottom:1px solid #000;
}
</style>

<input type="submit" style="text-align:left; color:#0000FF;" class="button" value="Go to new window" onClick="OpenWin1();">

I found the solution. The only thing is that IE opens the window on the left side of the screen and Firefox works on the right.

 

<a href="#" style="text-align:left; border: none; color:#0000FF; text-decoration:underline;" onClick="window.open ('filename.php', 'mywindow','height=650, width=650, left=30, right=30,top=20, scrollbars');">Screen Message</a>

I thought you were trying to style a button to look like a link? :confused:

 

Anyway.. I'm unable to recreate the behaviour you mentioned in my version of FF (3.6.15), but I imagine it's down to specifying both the left and right attributes. Remove "right=30" and you should be fine, though your code is broken at the moment for non-JS users.

 

Quick fix:

 

<a href="filename.php" style="text-align:left; border: none; color:#0000FF; text-decoration:underline;" onClick="window.open ('filename.php', 'mywindow','height=650, width=650, left=30, right=30,top=20, scrollbars'); return false;">Screen Message</a>
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.