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).
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With