I just started with html and css and stumpled across a problem i cant solve i got a menu with white text and black background
one of the menu points is also a dropdown. On hover the dropdown menu appears. It has white background and black text but i didnt found a way to change the
color of the original menu point from white to black if the dropdown menu is active
It would be greate help if someone would help me with the problem.
i know the page looks kind of crapy but its just a try for testing my dropdown menu
This is the html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
ul.menu-item ul li a { /* die links des drop downs sind schwarz statt weis wie im die links im menu-item */
display:block;
color: black;
font-family: Verdana;
font-size: 14px;
text-decoration: none;
}
ul.menu-item ul li { /*einstellung für die Liste des Dropddownkästchens */
float: none;
background: white;
text-align: center;
line-height: 24px;
width: 150px;
height: 24px;
margin: 0px 0px 0px 0px;
border: none;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
border-top-left-radius: 0px;
border-top-right-radius: 0px;
border-top: 1px solid;
border-color: black;
}
ul.menu-item ul li:hover{ /* notwendig, da sonst die unter Kante der Dropdown liste beim hover auch abflacht */
border-top-left-radius: 0px;
border-top-right-radius: 0px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
border: none;
border-top: 1px solid;
border-color: black;
}
Bookmarks