The CSS hover user action pseudo-class selector (x:hover{ }) is used to alter the style of an element when the user mouse hovers over an element on the page. The hover selector is most commonly used to change the way a menu item or button appears when the user mouse hovers on top of it.
Code:-
<!DOCTYPE html>
<style type="text/css">
.myList li {
background:#CEE7FF;
padding:12px;
margin:4px;
color:#06F;
}
.myList li:hover {
background:#B7FFC4;
padding:12px;
margin:4px;
color:#090;
}
</style>
<ul class="myList">
<li>List Item 1</li>
<li>List Item 1</li>
<li>List Item 1</li>
</ul>
Code:-
<!DOCTYPE html>
<style type="text/css">
.myList li {
background:#CEE7FF;
padding:12px;
margin:4px;
color:#06F;
}
.myList li:hover {
background:#B7FFC4;
padding:12px;
margin:4px;
color:#090;
}
</style>
<ul class="myList">
<li>List Item 1</li>
<li>List Item 1</li>
<li>List Item 1</li>
</ul>
No comments:
Post a Comment