+ 1
How can I add hover in my css code
I try to add the hover effect to my codes but I don't see it working A code like this .intro :hover{ border:1px solid; }
4 Answers
+ 9
Can we see your code?
+ 3
If you have the following:
p {
text-align: center;
}
You can add this as a separate style declaration
p:hover {
background-color: #ccccff;
}
+ 3
First, you have a space between .intro:hover
Second, you need content in your div. To activate the hover
<head>
<style>
.intro:hover {
border: 5px solid black;
}
</style>
</head>
<body>
<div class="intro">
<h2>The border Property</h2>
<p>This property is a shorthand property for border-width, border-style, and border-color.</p>
</div>
</body>
+ 3
because your border doesn't have a color.