Jump to content

a link on the whole li


djp1988

Recommended Posts

How can I get a whole <li> to be linked and not juste the test that is inside it?I am using a code to make the li background color change so it's sort of like the whole li is a button, but I want to make it so you can click anywhere inside the li not necessarily on the text to go to the desired page

Link to comment
Share on other sites

Well, what you can do is display the link as a block and apply all the style to the link. Example:HTML<ul><li><a href="URL">Link</a></li></ul>CSSli a {display: block;height: 2em;font-size: 1em;background-color: blue;}li a:hover {background-color: red;}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...