好吧,我的导航栏有一系列5个div,里面有文字。我想把它带到哪里,只要我将鼠标悬停在div上,div内的<p>
元素就会发光。我知道所有正确的css标签,以获得发光等等,但是当涉及到(div):hover {} css标签时,我感到难过,以识别我希望它们内部的文本发光,而不是整个DIV。下面是你需要的代码。
HTML
<div id="navBar">
<a class="navLinks" href="#"> <!-- Replace the # with your url or directory link, keep the "" around it. -->
<div class="navButtonsNorm" id="n1">
<p class="navTextNorm">Donate</p><!-- Replace the text between the <p></p> tags with your own link names. -->
</div>
</a>
<a class="navLinks" href="#"> <!-- Replace the # with your url or directory link, keep the "" around it. -->
<div class="navButtonsNorm" id="n2">
<p class="navTextNorm">Contact Me</p><!-- Replace the text between the <p></p> tags with your own link names. -->
</div>
</a>
<a class="navLinks" href="#"> <!-- Replace the # with your url or directory link, keep the "" around it. -->
<div class="navButtonsNorm" id="n3">
<p class="navTextNorm">Portfolio</p><!-- Replace the text between the <p></p> tags with your own link names. -->
</div>
</a>
<a class="navLinks" href="#"> <!-- Replace the # with your url or directory link, keep the "" around it. -->
<div class="navButtonsNorm" id="n4">
<p class="navTextNorm">About me</p><!-- Replace the text between the <p></p> tags with your own link names. -->
</div>
</a>
<a class="navLinks" href="#"> <!-- Replace the # with your url or directory link, keep the "" around it. -->
<div class="navButtonsNorm" id="n5">
<p class="navTextNorm">Home</p> <!-- Replace the text between the <p></p> tags with your own link names. -->
</div>
</a>
</div>
CSS
.navButtonsNorm {
width:150px;
height:50px;
border-right:1px inset black;
float:right;
background: rgba(254,254,254,1);
background: -moz-linear-gradient(top, rgba(254,254,254,1) 0%, rgba(240,240,240,1) 47%, rgba(219,219,219,1) 52%, rgba(226,226,226,1) 100%);
background: -webkit-gradient(left top, left bottom, color-stop(0%, rgba(254,254,254,1)), color-stop(47%, rgba(240,240,240,1)), color-stop(52%, rgba(219,219,219,1)), color-stop(100%, rgba(226,226,226,1)));
background: -webkit-linear-gradient(top, rgba(254,254,254,1) 0%, rgba(240,240,240,1) 47%, rgba(219,219,219,1) 52%, rgba(226,226,226,1) 100%);
background: -o-linear-gradient(top, rgba(254,254,254,1) 0%, rgba(240,240,240,1) 47%, rgba(219,219,219,1) 52%, rgba(226,226,226,1) 100%);
background: -ms-linear-gradient(top, rgba(254,254,254,1) 0%, rgba(240,240,240,1) 47%, rgba(219,219,219,1) 52%, rgba(226,226,226,1) 100%);
background: linear-gradient(to bottom, rgba(254,254,254,1) 0%, rgba(240,240,240,1) 47%, rgba(219,219,219,1) 52%, rgba(226,226,226,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fefefe', endColorstr='#e2e2e2', GradientType=0 );
}
.navTextNorm {
font-family:CODE Light;
font-size:24px;
color:black;
-webkit-text-stroke:1px;
text-align:center;
margin-top:15px;
}
.navLinks {
text-decoration:none;
}
.navLinks:hover{
}
谢谢,如果你能提供帮助的话。
答案 0 :(得分:0)
这是你的意思吗?
.navLinks:hover{
text-shadow:0 0 5px #ff0000;
}
零是x&amp; y偏移,然后是模糊的大小,然后是颜色。