html - Change a different link color on mouseover -
i have menu composed of multiple links, each followed descriptive paragraph. need paragraph change color whenever proper link highlighted, , vice-versa.
essentially, i'm looking way a:hover , change different link (ideally using css only, i'd avoid using js or jquery–if in fact possible @ all).
here's example:
<a class="title" href="page1.html">page 1</a> <hr/> <a class="description" href="page1.html">description of page 1</a> <br><br> <a class="title" href="page2.html">page 2</a> <hr/> <a class="description" href="page2.html">description of page 2</a> <br><br> <a class="title" href="page3.html">page 3</a> <hr/> <a class="description" href="page3.html">description of page 3</a>
thanks guys!
you can pure css if wrap elements under 1 parent element (div,p,etc)
remember change anchor styling enables change color. a{color:inherit}
.colorchanger { color:green; } .colorchanger:hover { color:blue; } a{ color:inherit; }
<div class = 'colorchanger'> <a class="title" href="page3.html">page 1</a> <hr/> <a class="description" href="page3.html">description of page 1</a> </div> <br><br> <div class = 'colorchanger'> <a class="title" href="page3.html">page 2</a> <hr/> <a class="description" href="page3.html">description of page 2</a> </div> <br><br> <div class = 'colorchanger'> <a class="title" href="page3.html">page 3</a> <hr/> <a class="description" href="page3.html">description of page 3</a> </div>
Comments
Post a Comment