homepage Welcome to WebmasterWorld Guest from 54.237.151.188
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
Change background-color on two layers on rollover
teelions

5+ Year Member



 
Msg#: 3550777 posted 4:31 pm on Jan 17, 2008 (gmt 0)

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?

Terry

 

lavazza

5+ Year Member



 
Msg#: 3550777 posted 4:58 pm on Jan 17, 2008 (gmt 0)

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?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved