4idy
4idy

Reputation: 3

Styling links with external style sheets

I'm trying to style one link on my page, which has the class=b2t

I want it to remain white at all times except when users mouse over it, in which case I want it to turn green.

I simply cannot figure out how to apply the hover and color properties to that one link within the class=b2t.

Can anyone advise me on this please?

<div id="container">
    <div id="b2t">
        <a class="b2t" href="#">
            <img src="images/backtotop.png">
            Back to top
        </a>
    </div>
</div>

Stylesheet:

a.b2t {
    position: relative;
    left: -50px;
    text-decoration: none;
}

Upvotes: 0

Views: 103

Answers (2)

theftprevention
theftprevention

Reputation: 5213

See this demo.

Try this:

a.b2t:link, a.b2t:visited, a.b2t:active {
    color: #fff;
    position: relative;
    left: -50px;
    text-decoration: none;
}
a.b2t:hover {
    color: #0f0;
}

Upvotes: 2

Geocrafter
Geocrafter

Reputation: 815

I think you are looking for this.

http://liveweave.com/tCa9uE

Just add:

a.b2t:hover { color: Green; }

Upvotes: 2

Related Questions