How to change the HTML Color Coding?

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
Darrel
Forum Commoner
Posts: 33
Joined: Fri Oct 10, 2014 2:30 am

How to change the HTML Color Coding?

Post by Darrel »

I am setting up a webpage, and have set the color for the links, in rest state and hover state. However, how can I add a portion of code so that a section of the text will have different color in rest state and hover state?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: How to change the HTML Color Coding?

Post by Celauran »

Add a class to the text and set a hover rule on the class.

Code: Select all

p.some-class:hover {
    color: green;
}

Code: Select all

<p class="some-class">Lorem ipsum dolor sit amet...</p>
Post Reply