我将CSS应用于特定标签,但无法正常工作。以下是我的代码:
HTML:

<div id="content">
        <div class="fixedwidth">
            <p><span class="date">2 April 2014 Last update at 15:23</p>
            <h1>Norwich 'explosion': Two people dead</h1>
            <img class="headlineimg" src="pictures/headline.jpg" />
            <div class="newsitem">
                <p>Two people have died in a suspected explosion at an industrial estate in Norwich.</p>
                <p><a href="">Protest shuts Heathrow Airport runway</a></p>
                <p><a href="">Harman 'happy to be overruled' on cuts</a></p>
                <p><a href="">Get poor pupils 'into schools early'</a></p>
                <p><a href="">Bird flu confirmed at Lancashire farm</a></p>

            </div>
        </div>
    </div>


CSS:

.newsitem a{
            color:#1F4F82
            text-decoration:none;
        }

.newsitem a:hover{
            text-decoration:underline;
        }


谁能告诉我我的代码有什么问题吗?谢谢。

最佳答案

在您的第一个声明中,设置颜色后您缺少了分号

关于html - 将CSS应用于特定的<a>标记,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31389125/

10-11 23:35
查看更多