Jump to content

Display a link as text


facarroll

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>

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.