css - 链接被插入到我没有放置它们的内容中

标签 css html

我在标题图片上放了一个指向主页的链接,但该链接出现在我网页上的所有按钮、标题和段落上。是什么赋予了?请查看我的 css 和 html,可能非常简单。

HTML:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Заголовок страницы</title>
        <link href="css/style.css" type="text/css" rel="stylesheet" />
    </head>
    <body>
        <div id="wrapper">
            <div id="header">
            <div id="logo">
                <a href src="index.html"><img src="images/logo.png" alt="Logo"/></a>
            </div>
                <div id="menu">
                <ul>
                    <li><a class="current" href src="#">Home</li>
                    <li><a href src="#">About</li>
                    <li><a href src="#">Contact</li>
                    <li class="phone">Call Us: <span>416-514-0370</span></li>
                </ul>
                </div>
            </div>
        <div id="content">
        <h1>We are coming soon..</h1>
        </div>
        </div>
    </body>
</html>

CSS:

@import url(reset.css);
body {
    background: url(../images/background.png) repeat;

}

#wrapper{
    width: 960px;
    margin: 0 auto;
}

#logo{
    width: 204px;
    height: 136px;
    float: left;
}

#menu{
    width: 960px;
    height: 70px;
    background: url(../images/menu-bg.png) no-repeat;
}

#menu ul {
    padding-left: 40px;
    padding-top: 15px;
    overflow: hidden;
}

#menu ul li{
    float: left;
    font: bold 18px Arial;
    color: #FFFFFF;
    margin-right: 70px;
    margin-top: 10px;
}

#menu ul li a {
    color: #FFFFFF;
    text-decoration: none;
}

#menu ul li span {
    color: #F51111;
}

#menu .current, #menu ul li a:hover {
    text-decoration: underline;
    cursor: pointer;
}

#menu .phone{
    float: right;
    margin-right: 30px;
}

#content h1 {
    font: bold 55px Arial;
}

最佳答案

你错过了 </a>

<li><a href src="#">About</a></li>

关于css - 链接被插入到我没有放置它们的内容中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36441523/

相关文章:

javascript - 使用表单时删除缓存的搜索

html - 需要溢出-y :auto/scrolling 的帮助

javascript - 使用用户插入的 xml 文件填充 html 表单

css - 元素未对齐

html - 定位多个图像的中间

html - UserComments 架构上的 dtstart 警告

html - 定义列表 <dl> 是否要求每个 <dd> 都有 <dt> 标签?

html - 正则表达式解决方案,无法访问以前易于访问的 nba STATS url

javascript - 使用 jquery 动画圆形缩略图大小在鼠标悬停时增长

css - 无法删除 CSS 类 a : hover background-color