Angry Goomba
Angry Goomba

Reputation: 470

Change <a>'s hover / active color within the element tag

I'm working on an e-mail signature (so obviously I don't have an attached .css stylesheet) is there any way to set a link's hover / active color (maybe within the tag?) Thanks for taking the time to answer :) Tombs

Duplicate here: How to write a:hover in inline CSS?

Upvotes: 0

Views: 1745

Answers (4)

Jack
Jack

Reputation: 1941

You can't do so within HTML as active and hover are CSS selectors and not attributes. So although you could set the height and width of an object in HTML, you would have to use CSS to use the active and hover selectors.

Like such

HTML

<ul>
    <li><a class="links" href="#"> Link1 </a></li>
    <li><a class="links" href="#"> Link2 </a></li>
    <li><a class="links" href="#"> Link3 </a></li>
</ul>

CSS

ul il a.links:hover{
color: blue;
}

ul il a.links:hover{
color: royalblue;
}

Upvotes: 1

Lucca Dornelles
Lucca Dornelles

Reputation: 31

Try using

<h1 style="---"> 

like

<h1 style="color:red">hi</h1>

Upvotes: 0

zonabi
zonabi

Reputation: 746

you may only be able to style the active color, with this being a recommended approach

 <a href="http://somesite.com/" style="color:#ff00ff"><span style="color:#ff00ff">this is a link</span></a>

style the <a> tag as well as wrap it in a similar color style <span> tag for reinforcement.

you wont be able to style a hover state with in-line css unfortunately.

source: http://24ways.org/2009/rock-solid-html-emails/

Upvotes: 0

Diodeus - James MacFarlane
Diodeus - James MacFarlane

Reputation: 114347

Half of the mail clients do not support this functionality.

See: http://www.campaignmonitor.com/css/

Upvotes: 0

Related Questions