0

好的,我有这个导航栏,它包含一系列 5 个 div,其中包含文本。我想让它到达每当我将鼠标悬停在 div 上时,div<p>内的元素就会发光。我知道所有正确的 css 标签来获得发光等,但是当涉及到 (div):hover { } css 标签时我很难过,因为我希望它们里面的文本发光,而不是整个分区。这是您需要的代码。

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{

}

谢谢,如果你能帮忙。

4

1 回答 1

0

你是这个意思吗?

.navLinks:hover{
    text-shadow:0 0 5px #ff0000;
}

其中零点是 x 和 y 偏移量,然后是模糊的大小,然后是颜色。

于 2013-05-31T05:23:01.493 回答