how to change the color of an element when the mouse enters?
- نفیسه افقی 8 ماه قبل سوال کرد
- آخرین ویرایش 8 ماه قبل
- شما باید برای ارسال دیدگاه وارد شوید
Use the hover
keyword to change the style of an element when the mouse enters it.
p:hover, h1:hover, a:hover {
background-color: blue;
font-size: 150%
}
* To change the color of a link in different situations use this code:
<html>
<head>
<style>
/* unvisited link */
a:link {
color: blue;
}
/* visited link */
a:visited {
color: green;
}
/* mouse over link */
a:hover {
color: red;
}
/* selected link */
a:active {
color: yellow;
}
</style>
</head>
<body>
<p>visit the website: <a href="https://mustang.ir/questions/">https://mustang.ir/questions</a></p>
</body>
</html>
- نفیسه افقی 8 ماه قبل پاسخ داد
- شما باید برای ارسال دیدگاه وارد شوید
پاسخ شما