Rollover div without hyperlink?

Discussion in 'CSS' started by cocoMonkey, Apr 22, 2007.

  1. #1
    Hi guys,

    How do you highlight a div on rollover without having it as a hyperlink?


    Checkout this example on the microsoft site:

    http://office.microsoft.com/en-us/word/default.aspx

    Roll your mouse over the box with the search in it. It highlights a light blue, but it isnt a link. Same goes for the other boxes on there.

    Any way to achive this effect would be sweet.

    Cheers.


    (p.s also got to say, that ms site looks really great doesnt it?!)
     
    cocoMonkey, Apr 22, 2007 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    They're using javascript. In fact, the page requires javascript for no good reason.

    Just add onmouseover and onmouseout event handlers to the element you want to alter.

    in re your ps: Kinda not really. The font size is overly small for a site aimed at the general population. In the same vein, there is not enough contrast between the text color and the background. If you were to try to use the page from your web enabled PDA or cell, you'd likely end up pissed because of the requirement for javascript. If you had a disability that required assistive technology, you'd be SOL. It has a generally cluttered 'feel'.

    cheers,

    gary
     
    kk5st, Apr 22, 2007 IP
  3. cocoMonkey

    cocoMonkey Active Member

    Messages:
    305
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #3
    ah, i thought it was done with css -- i wouldnt fancy using javascript.

    Cheers mate.

    -- good points about the ms site, but there is still somthing i just "like" about it. It might just be the colours they've used ;)
     
    cocoMonkey, Apr 22, 2007 IP
  4. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #4
    There's no particular reason not to use javascript, as long as it's an enhancement, and not required to use the page.

    cheers,

    gary
     
    kk5st, Apr 22, 2007 IP