facarroll Posted March 7, 2011 Share Posted March 7, 2011 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 More sharing options...
doddsey_65 Posted March 7, 2011 Share Posted March 7, 2011 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();"> Link to comment https://forums.phpfreaks.com/topic/229855-display-a-link-as-text/#findComment-1183902 Share on other sites More sharing options...
facarroll Posted March 7, 2011 Author Share Posted March 7, 2011 Thanks for your reply. I tried both options, and I assume I place it in the HEAD part of the document. (Although I tried BODY also). Nothing made any difference. Cheers. Link to comment https://forums.phpfreaks.com/topic/229855-display-a-link-as-text/#findComment-1183921 Share on other sites More sharing options...
doddsey_65 Posted March 7, 2011 Share Posted March 7, 2011 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();"> Link to comment https://forums.phpfreaks.com/topic/229855-display-a-link-as-text/#findComment-1183923 Share on other sites More sharing options...
facarroll Posted March 7, 2011 Author Share Posted March 7, 2011 No joy I'm afraid. In IE I get a stylised button with an underlined text link inside and in FF there is no effect. Link to comment https://forums.phpfreaks.com/topic/229855-display-a-link-as-text/#findComment-1183938 Share on other sites More sharing options...
facarroll Posted March 9, 2011 Author Share Posted March 9, 2011 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> Link to comment https://forums.phpfreaks.com/topic/229855-display-a-link-as-text/#findComment-1184976 Share on other sites More sharing options...
Adam Posted March 9, 2011 Share Posted March 9, 2011 I thought you were trying to style a button to look like a link? 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> Link to comment https://forums.phpfreaks.com/topic/229855-display-a-link-as-text/#findComment-1184985 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.