Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies

Change background-color on two layers on rollover



4:31 pm on Jan 17, 2008 (gmt 0)

5+ Year Member

I have a div with two adjacent divs inside. The two insider divs have background colors of #D36530 (div1) and #577994 (div2). I want to have both divs change background colors when any one of them is rolled over. The change to colors would be #98000D (div1) and #D7E6F1(div2). I also need the text color of div2 to change from #ffffff to #646767 at the same time (text color of div1 remains the same). How do I accomplish this?



4:58 pm on Jan 17, 2008 (gmt 0)

5+ Year Member

My 'rule of thumb':

HTML for content
CSS for presentation
Javascript (or similar) for behaviour

Deviating from this ought to be a 'considered' decision

I have a hunch that you could achieve the desired behaviour effects via CSS (e.g. pseudo classes [w3schools.com])... but, to me, that seems a bit of a tortuous route compared with the relative simplicity of javascript (or similar)

But then, what do I know?


Featured Threads

Hot Threads This Week

Hot Threads This Month