Hi,

I have hyperlinked texts and i want to remove the underline and blue color also.

I removed underline but not the blue color i want the font to be in black??

Here is the code:

<html>
<body>
<A STYLE="text-decoration:none href=http://www.google.com>This is an example for automatic term mapping</A>
</body>
</html>

How can i get the font color of the sentence in black color???

Any idea??

Regards
Vandhita

Dani AI

Generated

Browsers apply default link styles (blue, underlined, purple when visited). To get black, non-underlined text reliably, you need to override all relevant link states. Avoid JavaScript for this; CSS is sufficient and more performant.

Example (site-wide):

/* Make links look like regular black text, but show an affordance on hover/focus */
a,
a:visited {
  color: #000;
  text-decoration: none;
}
a:hover,
a:focus {
  text-decoration: underline; /* keeps usability */
}
a:focus-visible {
  outline: 2px solid #005fcc; /* keyboard users */
  outline-offset: 2px;
}

If you only want some links to look like plain text, scope it to a class:

/* Only links with class="link-plain" inherit surrounding color and drop the underline */
a.link-plain,
a.link-plain:visited { color: inherit; text-decoration: none; }
a.link-plain:hover,
a.link-plain:focus { text-decoration: underline; }

Tips:

  • Include a:visited or visited links may remain purple. Modern browsers restrict :visited styling to color for privacy; other properties are ignored. See MDN: :visited.
  • Ensure sufficient contrast and a visible focus/hover state so links are still discoverable. Guidance: WebAIM: Links and Hypertext and MDN: :focus-visible.
  • Prefer external CSS so the rule is cached across pages.

Recommended Answers

All 4 Replies

Try doing this : <a href="http://www.someplace.com/" style="text-decoration : none; color : #000000;">http://www.someplace.com</a> or if you want to apply it with all the links in your page.

<html>
<head>
<title>Some title</title>
<style type="text/css">
<!--
a { text-decoration : none; color : #000; }
-->
</style>
</head>
<body>
<div>
<a href="http://www.link1.com/">Link1</a><br>
<a href="http://www.link2.com/">Link2</a><br>
<a href="http://www.link3.com/">Link3</a>
</div>
</body>
</html>

Try this:

<html>
<body>
<a style="color:black; text-decoration:none" href="http://www.google.com"> This is an example for automatic term mapping</a>            
</body>
</html>

Go with essential's answer
its better to separate style and content,
the css can be externalised (once) when you have the page design right
for the entire site and reduced file sizes - download times are always a good thing
else every element that has to be styled needs style=" bleep loads of style text margin border padding color background "

Why dont you use dream weaver man just use it and work in html or any other language as you are working on Microsoft word.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.