Jump to content

HTML code for changing link colour?


byron2k12

Recommended Posts

I have used google search, only problem is that i am using code to create links "without" underlines at the moment, this is the html i am using for that:

<p><a href="http://examplelink.com" style="text-decoration: none">Example Text</a></p>

 

It works great but when i try to implement html link-colour codes for that, i get nothing. Can anyone help, thanks.

Link to comment
https://forums.phpfreaks.com/topic/266309-html-code-for-changing-link-colour/
Share on other sites

Try using styles in the head of your HTML document or put them in a desperate file and link that to your document.

 

In head of file:

<style type="text/css">
a { 
text-decoration:none;
color:#cc0000;
}
</style>

 

Make sure in your CSS your are spelling colour as color. The American way.

When using inline CSS make sure you are ending each statement with a semicolon.

 

<a href="#" style="text-decoration:none;color:#000000;">Link</a>

 

However. If you are going to be using the same style on a number of different anchor links and or on a number of pages, it is best to use external style sheets.

  • 4 weeks later...

I have used google search, only problem is that i am using code to create links "without" underlines at the moment, this is the html i am using for that:

<p><a href="http://examplelink.com" style="text-decoration: none">Example Text</a></p>

 

It works great but when i try to implement html link-colour codes for that, i get nothing. Can anyone help, thanks.

lets see the code that doesnt work.

  • 2 weeks later...
  • 4 weeks later...
  • 2 months later...

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.