moodox Posted October 7, 2008 Share Posted October 7, 2008 Hello all, Im an absolute beginner at all of this im afraid so I appologise in advance if my question is a little simple! Ive added a hyperlink to our esite which is working but it appears underlined. I had a look on the various forums and tried adding a style switch but it didnt work. Here is the line <a href=http://www.technomed.co.uk target=_blank ><font color=black>Testing hyperlink</a> Thanks for any help you can offer. Joel Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/ Share on other sites More sharing options...
Brandon Jaeger Posted October 7, 2008 Share Posted October 7, 2008 Not a PHP question, but this should do the trick: <font color="black" style="text-decoration: none;"> Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659214 Share on other sites More sharing options...
dennismonsewicz Posted October 7, 2008 Share Posted October 7, 2008 here ya go: <a href="http://www.technomed.co.uk" target="_blank" style="text-decoration: none"><font color=black>Testing hyperlink</a> Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659217 Share on other sites More sharing options...
dennismonsewicz Posted October 7, 2008 Share Posted October 7, 2008 Brandon: Your code will only remove the hyperlink in IE not firefox. Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659220 Share on other sites More sharing options...
dennismonsewicz Posted October 7, 2008 Share Posted October 7, 2008 also make sure you close the <font> tag right before the <a> tag! </font></a> Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659221 Share on other sites More sharing options...
moodox Posted October 7, 2008 Author Share Posted October 7, 2008 Thanks Brandon/Dennis thats great. Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659226 Share on other sites More sharing options...
DeanWhitehouse Posted October 7, 2008 Share Posted October 7, 2008 The correct way <a href="http://www.technomed.co.uk" target="_blank" style="text-decoration: none;color:black;">Testing hyperlink</a> Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659239 Share on other sites More sharing options...
tmallen Posted October 7, 2008 Share Posted October 7, 2008 No, that's a very bad approach. What if you want all links to appear this way? What you need to do is link a stylesheet: <link href="path/to/screen.css" media="screen" type="text/css" rel="stylesheet" /> And in screen.css, add: a { text-decoration: none; } Also, quote your attributes as in my first example, and get rid of the font tag. Instead, ask yourself, "why does this need to be black?" Let's say that it needs to be black because you hate the site and think it's smelly. In that case, change your link to: <a href="whateverurl" class="smelly">link text</a> <!-- People know how to open new windows. Only do it for them if you must --> Then, you'd add this to your screen.css file: a.smelly { color: black; } And you could make any smelly links appear in that color. Or, if you want all links to be black, move that "color: black;" line to the other rule ("a {") right below the text-decoration rule. Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659246 Share on other sites More sharing options...
DeanWhitehouse Posted October 7, 2008 Share Posted October 7, 2008 It's not a bad approach, if he said he wanted all his links to be the same style then we could of shown him how to, and your way is a 'bad' approach, why make an external style sheet, when you can just use internal CSS ? (as it is only doing his links, on one page as far as we know) Please don't jump to conclusions Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659247 Share on other sites More sharing options...
tmallen Posted October 7, 2008 Share Posted October 7, 2008 Allow me to approach this from a practical point of view: Nobody makes something some way for a completely arbitrary reason. There is always a purpose when it comes to websites. If you're just coloring links for fun, your users will be confused. But if there's some semantic reason, you want to build that in a maintainable manner. Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659251 Share on other sites More sharing options...
DeanWhitehouse Posted October 7, 2008 Share Posted October 7, 2008 Again you make an assumption, do not say no-body colors links for fun, how do you know that? How do you know he isn't making a site with lots of different color links? Please do not tell people they are doing it badly because they are not being your way. It's his/her website, they can do it how they want. If this is solved, please press solved at the bottom of the screen. Thanks, Blade (p.s. can a mod lock this, it is going off topic) Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659257 Share on other sites More sharing options...
tmallen Posted October 7, 2008 Share Posted October 7, 2008 I thought it's an interesting discussion on CSS and web usability, but that's just me. In any case, let me get a word in: Links shouldn't be colored at random. It confuses users. That is, unless you're treating the web as an artistic medium (which would put you in a tiny minority of web designers) rather than as a way to deliver information and engage users. Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659264 Share on other sites More sharing options...
DeanWhitehouse Posted October 7, 2008 Share Posted October 7, 2008 Or he/she may just want this one link to be different? Who know's, it's his/her choice, and doesn't really affect us at all, lolz. Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659267 Share on other sites More sharing options...
tmallen Posted October 7, 2008 Share Posted October 7, 2008 This is what I do for a living, so it's always on my mind. Like I said above though (in my code examples), even if it's just one link, there's still some reason. I can't remember a single time I've edited a site, built a comp, etc. where such a simple style was used only once in the site. In any case, it's better to isolate the CSS in the <head> even with non-descriptive class names than to use inline styles which are pretty much unmaintainable. Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659270 Share on other sites More sharing options...
DeanWhitehouse Posted October 7, 2008 Share Posted October 7, 2008 I never said it was bad, and tbh we don't need to know what you do for a living nor does it matter. All I am saying is that there is no point for someone (who seems to have little HTML experience, and probably even less if any CSS) to make a style sheet, include it and apply it for one link. If he asked how to do that we would have told him but the fact remains he asked how to make that link black and underlined. Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659272 Share on other sites More sharing options...
tmallen Posted October 7, 2008 Share Posted October 7, 2008 I mean, I explained the reasoning throughout and it's clear that the solution is a bit over-engineered for a single style change. But it surely doesn't hurt to educate, and your "who are you to assume..." stance contrasts pretty sharply with the fact that you don't like me suggesting useful, accurate, relevant information here. Next time I'll just highlight and bold "BAD" so that people insistent on judging a post based on a negative word can get to the point faster. Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659275 Share on other sites More sharing options...
aebstract Posted October 7, 2008 Share Posted October 7, 2008 tmallen, who said he wanted all of his links to not have the underlined mark? a { text-decoration: none; } There may be ONE spot on his website, where a link needs to be without an underlined mark and all of his others are fine. Think of that one? Maybe he is making a website where you click a link and go to another page and there is only one link to click per page. Why? Who knows... he's making his website for his reasoning and I am sure there is one. Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659276 Share on other sites More sharing options...
tmallen Posted October 7, 2008 Share Posted October 7, 2008 Based on: Ive added a hyperlink to our esite which is working but it appears underlined. I made an educated guess that this was in adherence to some style guide, organized or not. Also, even with one link per page, it still would become a maintenance nightmare pretty quickly. Linking to the stylesheet means you can use the same styles for each and every page, and you save a tiny amount of bandwidth (I remember when that was a big argument around '99 for CSS). Of course, the chances that the OP continued following this thread after they found their solution is... Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659283 Share on other sites More sharing options...
DeanWhitehouse Posted October 7, 2008 Share Posted October 7, 2008 @tmallen Feel free to give advice, but don't tell people they are doing something bad just because it is not how you want it or would of done it, if you wish to educate him/her why did you not explain the good and bad points to using your way instead of just saying that his was is bad. Maybe give him/her a link to a site like w3schools which can explain it better and more indepth. This is nothing personal, just that you shouldn't assume that he/her want's to do something they didn't ask. Ive added a hyperlink to our esite which is working but it appears underlined. Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659286 Share on other sites More sharing options...
moodox Posted October 7, 2008 Author Share Posted October 7, 2008 Sorry I wasnt too clear. The idea was to remove from only one link. Problem solved, thanks again for all of your replies. Joel Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659288 Share on other sites More sharing options...
aebstract Posted October 7, 2008 Share Posted October 7, 2008 I made an educated guess = assumption =[ Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659333 Share on other sites More sharing options...
sylvertwst Posted October 7, 2008 Share Posted October 7, 2008 lock \o/ Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659476 Share on other sites More sharing options...
haku Posted October 8, 2008 Share Posted October 8, 2008 the font tag has been deprecated and shouldn't be used. Quote Link to comment https://forums.phpfreaks.com/topic/127434-underlined-hyperlink/#findComment-659541 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.