html - Want to set backgroud color of my menu item -
here html code:
<nav id="nav"> <ul> <li> <a href="#"> home </a> </li> <li> <a href="#"> </a> </li> <li> <a href="#"> photos </a> </li> <li> <a href="#"> contact </a> </li> </ul> </nav>
what code should changing background colour ?
your question doesn't provide enough information. however, bullet list can assume using and/or
<ul> <li>home</li> <li>about us</li> <li>photos</li> <li>contact</li> </ul>
the efficient way color backgrounds of elements use css styles. in css file want use selector select
ul li { background-color:blue; }
this css code change background color of each element. however, if have multiple lists , don't want them have blue background, must give class in html file.
<ul class="nav"> <li>home</li> <li>about us</li> <li>photos</li> <li>contact</li> </ul>
then in css code able target "nav" class directly.
#nav li { background-color:blue; }
hope helps. in future, provide more details code , question.
Comments
Post a Comment