Box的类选择器不起作用

时间:2013-03-08 16:23:49

标签: css class menu css-selectors

我不知道为什么这段代码不起作用。

在我的CSS中:

.box_nav{
        display:block;
        background: rgba(255,255,255,.75);
        width:500px;
        height: 200px;
        padding:30px;
        border:0px ;
        margin-top:20px;
        margin-left:100px;
}

这是我希望它适用于我的身体:

<div class="box_nav" id="main_menu"> 
        <!-- Experiments _______________________________________ -->
                <a href="Experiments.html">EXPERIMENTS</a><br>
                <a href="Exp_1.html" ><img border="0" alt="Experiment 1" width="150" height="150" src=" images/Experiment_1.jpg " onmouseover="this.src=' images/Experiment_1a.jpg '" onmouseout="this.src=' images/Experiment_1.jpg'"  /></a>
                <a href="Exp_2.html" ><img border="0" alt="Experiment 2" width="150" height="150" src=" images/Experiment_2.jpg " onmouseover="this.src=' images/Experiment_2a.jpg '" onmouseout="this.src=' images/Experiment_2.jpg'"  /></a>
                <a href="Exp_3.html" ><img border="0" alt="Experiment 3" width="150" height="150" src=" images/Experiment_3.jpg " onmouseover="this.src=' images/Experiment_3a.jpg '" onmouseout="this.src=' images/Experiment_3.jpg'"  /></a>
                <a href="Exp_4.html" ><img border="0" alt="Experiment 4" width="150" height="150" src=" images/Experiment_4.jpg " onmouseover="this.src=' images/Experiment_4a.jpg '" onmouseout="this.src=' images/Experiment_4.jpg'"  /></a>
                <a href="Exp_5.html" ><img border="0" alt="Experiment 5" width="150" height="150" src=" images/Experiment_5.jpg " onmouseover="this.src=' images/Experiment_5a.jpg '" onmouseout="this.src=' images/Experiment_5.jpg'"  /></a>
                <a href="Exp_6.html" ><img border="0" alt="Experiment 6" width="150" height="150" src=" images/Experiment_6.jpg " onmouseover="this.src=' images/Experiment_6a.jpg '" onmouseout="this.src=' images/Experiment_6.jpg'"  /></a><br>
        <!-- Writing ____________________________________________-->
                <a href="Writing.html">WRITING</a><br>
        <!-- Photography -->
                <a href="Photography.html">PHOTOGRAPHY</a><br>
        <!-- Graphics -->
                <a href="Graphics.html">GRAPHICS</a><br>
        <!-- Art Work -->
                <a href="Artwork.html">ART WORK</a><br>
    </div>

你可以看到二级菜单 - Contact,Modernist Summer和Footer,都按照我希望的方式工作。这是代码:

的CSS:

.box_sec_nav{
        display:block;
        background: rgba(255,255,255,.75);
        width:500px;
        height: 75px;
        padding:30px;
        border:0px ;
        margin-top:20px;
        margin-left:100px;
}

HTML:

<div id="sec_menu" class="box_sec_nav">
        <!-- Contact ________________________________________________________________________-->
            <a href="Contact.html">Contact + R&#233;sum&#233;</a><br>
        <!-- Modernist Summer Link __________________________________________________________-->    
            <a href="http://www.modernistsummer.com">Modernist Summer</a><br>               
        <!-- Baselika _______________________________________________________________________-->
            <a href="http://baselika.com" target="_blank">baselika</a><br>

    </div>

那么为什么我的样式在二级菜单上而不是另一个呢?我尝试验证这个并且我得到了css .box_nav的Parse Error但是我没有得到我做错了。

谢谢!

0 个答案:

没有答案