Page 1 of 1

How to change the HTML Color Coding?

Posted: Tue Nov 11, 2014 11:41 pm
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?

Re: How to change the HTML Color Coding?

Posted: Wed Nov 12, 2014 6:33 am
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>