MadFly Posted November 27, 2008 Share Posted November 27, 2008 How can i do this?If i have a normal menu like...<menu><ul><a href="#">Menu Item</a></ul><ul><a href="#">Menu Item</a></ul><ul><a href="#">Menu Item</a></ul></menu>how should the code be in my css file? Link to comment Share on other sites More sharing options...
ccs Posted November 27, 2008 Share Posted November 27, 2008 making the menu change color when your mouse is over an menu itemis I think, the same as the term "rollover''I am all new to HTML and can not give you the answer as to how, but I know the ''rollover'' topic is included in the tutorials. I am sure if you look up the topic, you could find your solution.Good luck! Link to comment Share on other sites More sharing options...
djdawkins Posted November 27, 2008 Share Posted November 27, 2008 is I think, the same as the term "rollover''I am all new to HTML and can not give you the answer as to how, but I know the ''rollover'' topic is included in the tutorials. I am sure if you look up the topic, you could find your solution.Good luck!hi,you need to set 2 different styles in your sheet, one for element 'a', and one for 'a:hover'. if you just want the colour to change, just set a different color value in each styleI don't use the <menu> tag myself but am confident this works Link to comment Share on other sites More sharing options...
Ingolme Posted November 27, 2008 Share Posted November 27, 2008 The menu element was deprecated in HTML 4.01 and is not supported in XHTML 1.0.If you want the color of each item to change when the mouse is over, just do this: li a {display: block; /* This will make the hover of the link fit the whole <li> element */background-color: white;}li a:hover {background-color: red;} Some people would say to put the :hover on the <li> element, but this doesn't work in Internet Explorer 6. I also highly recommend a Strict DTD (XHTML 1.0 Strict or HTML 4.01 Strict), because CSS will only work predictably with those kind of DTDs.I personally recommend HTML over XHTML, because most likely, the day your site is displayed with an XHTML MIME type it won't render because of XML errors (Things like "<" and "&&" in your scripts and other things). Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.