cearlp Posted November 9, 2008 Share Posted November 9, 2008 Hello, Don't know if this is the correct forum for my question but here goes... I use PHP within an html file to generate table data. The table data are links and by default they are underlined. I want to eliminate the underlining and have tried to do this using CSS and a rule for anchors. Ex: a {text-decoration: none;} This does not work and I can only think that it is because the <td>.....</td> is generated with an echo statement in PHP. Here is the code: echo "<tr style='background color:$bgcolor;'><td><a href='".$_SERVER['PHP_SELF']."?memberid=$id'>$name</a></td></tr>"; The html page is rendered correctly and the links work as planned. I just want to get rid of the underlines under the name. Any thoughts? Quote Link to comment https://forums.phpfreaks.com/topic/132035-solved-php-in-html-files/ Share on other sites More sharing options...
genericnumber1 Posted November 9, 2008 Share Posted November 9, 2008 All php code is executed before it is sent to the browser, so there's no way php could mess up your css. Debug as if php isn't even there (assuming the html under view-source looks okay). Is there another css property below the one you're defining that overrides the anchor setting you're trying to use to change the underlining? Quote Link to comment https://forums.phpfreaks.com/topic/132035-solved-php-in-html-files/#findComment-686143 Share on other sites More sharing options...
Mchl Posted November 9, 2008 Share Posted November 9, 2008 a elements get what's called pseudo-classes. You have to define style for all of them I think (or at least a:link ) http://www.w3schools.com/CSS/tryit.asp?filename=trycss_link Quote Link to comment https://forums.phpfreaks.com/topic/132035-solved-php-in-html-files/#findComment-686152 Share on other sites More sharing options...
genericnumber1 Posted November 9, 2008 Share Posted November 9, 2008 No, you can globally set all anchor tags to have no underlining with a { text-decoration: none; } assuming they aren't redefined to have underlining later by accident. Quote Link to comment https://forums.phpfreaks.com/topic/132035-solved-php-in-html-files/#findComment-686171 Share on other sites More sharing options...
Mchl Posted November 9, 2008 Share Posted November 9, 2008 Ok then. I'm not really into HTML/CSS Quote Link to comment https://forums.phpfreaks.com/topic/132035-solved-php-in-html-files/#findComment-686179 Share on other sites More sharing options...
Yesideez Posted November 9, 2008 Share Posted November 9, 2008 Would actually be handy to see what CSS you've got defined already. For example, if you've assigned your style to a class name and not the element. Better off in the CSS forum though... Quote Link to comment https://forums.phpfreaks.com/topic/132035-solved-php-in-html-files/#findComment-686205 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.