change of style for two targeted areas - one link

Discussion in 'CSS' started by xira, Sep 19, 2008.

  1. #1
    Perhaps this is simple (hope so) - I need an image background to change in the middle of the site AND the corresponding menu item to change bgcolor, when someone hovers it. (And vice versa)

    .class a, .class a:link, .class:active{
    style...
    }

    .class a:hover, .class:focus{
    new/changed style...
    }

    But this only works for the direct link (anchor). How do it target another div and class too?
     
    xira, Sep 19, 2008 IP
  2. StrangeLife

    StrangeLife Well-Known Member

    Messages:
    269
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    140
    #2
    OK this is quite a confusing question, do you have the example site to see what you mean?
    I give it a go answering your question.
    I believe you want to change your background of your website to an image, this can be done via css..

    body {
    	margin: 0px;
    	padding: 0px;
    	background: #white url(yourimageurl) repeat-x;
    	) repeat-x left;
    	
    }
    Code (markup):
    Find the body tag in your css, apply and modify the above code.

    For an interactive menu i always refer to the listamatic website:

    http://css.maxdesign.com.au/listamatic/

    They have code examples and tutorials on navigations. :)
     
    StrangeLife, Sep 19, 2008 IP
  3. xira

    xira Active Member

    Messages:
    315
    Likes Received:
    8
    Best Answers:
    4
    Trophy Points:
    68
    #3
    Take a look http://xira.net/zaidler/
    You'll notice that each subject of the menu corresponds to one of the photos. The client wants when someone rolls-over figurative, then the first image on the top left changes... and vice versa.

    My thinking is CSS can't do it. This has to be JS or AJAX since by default you have to declare "what" is the second item being changed before you can change it.

    I haven't done JS programming in years... so I am hoping there is some CSS fix.
     
    xira, Sep 19, 2008 IP
  4. StrangeLife

    StrangeLife Well-Known Member

    Messages:
    269
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    140
    #4
    StrangeLife, Sep 19, 2008 IP
  5. xira

    xira Active Member

    Messages:
    315
    Likes Received:
    8
    Best Answers:
    4
    Trophy Points:
    68
    #5
    It's not exactly, but its a good start. I'll take a look and see what I can do with it. thanks!
     
    xira, Sep 19, 2008 IP