HTML change link color inline | (Hyperlink, Anchor tag, href)

Use CSS color property to change the link color inline in HTML. You can use color code (hex color codes) or direct the name of the color as a value of color.

Examples of Change hyperlink color HTML

There are three ways of changing the herf Hyperlink color: inline, internal, and external CSS.

Inline style method

Add the style attribute directly to the anchor tag and specify the color property through the style attribute, then assign a color value.

Output:

HTML change link color inline

Internal CSS method

For Internal CSS code you have to use <head> section of your HTML document. In the <style> tag, we set the color of our link <a> tag.

It will change the all anchor tag color if you want only single or specific then set id or class.

change anchor tag color in HTML hyperlink

Q: How to change anchor tag color in HTML?

Answer: Tp changes the color of an HTML link use the CSS color property on the anchor tag with whatever color Hex you want, in the example below used red color.

Do comment if you have any questions and suggestion on this topic.

Note: The All HTML Examples codes are tested on the Firefox browser and the Chrome browser.

OS: Windows 10

Code: HTML 5 Version


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.