Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to not make text colored within a href link but the text is also within div?

Tags:

html

css

colors

How can I make text NOT blue colored when I make entire div as a link?

So in the following snippet:

<a href="/link"><div><h2>LINK</h2></div></a>

I want to make the entire div be linked to another page, but also don't want to get the string LINK as blue colored as is the case with usual linking object.

When I wrote the following CSS:

a {text-decoration: none; background-color: none; }

it didn't change at all.

[Update]

Thanks for many answers. The reason I want to put div inside a is that I want to make the block linkable object (click on the block and go to another page). I first put a inside div, but it didn't work, and that's why I put it outside div. (and I use HTML5 and CSS3).

like image 361
Blaszard Avatar asked Sep 11 '13 09:09

Blaszard


People also ask

How do I hide hyperlink color?

Click on the menu command Format | Edit Styles | Link to show the Link Styles dialog. Type a new link style name, such as "Hyperlinks", and press OK. Set Underlining to None, and Text colour to None or Specified, as required.

How do I change font color in href?

Complete HTML/CSS Course 2022 To change the color of links in HTML, use the CSS property color. Use it with the style attribute. The style attribute specifies an inline style for an element. Use the style attribute with the CSS property color to change the link color.


1 Answers

css:

.link
{
  text-decoration: underline;
color: #0000EE;
font-size: 16px;
}

html:

<strong>Hello!</strong> you have already registered , you can login
<a href="http://www.example.com/"><span class="link">here</span></a>  

reference:

default HTML/CSS link color and this

Wikipedia Link Color lists different link color and their meanings.

Hope this helps.

like image 100
Shaiju T Avatar answered Sep 28 '22 20:09

Shaiju T