Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html CSS多个ID-并非所有ID都有效_Html_Css - Fatal编程技术网

Html CSS多个ID-并非所有ID都有效

Html CSS多个ID-并非所有ID都有效,html,css,Html,Css,我有一个问题,多个ID与CSS不工作 这是我的完整代码: /*向顶部导航添加黑色背景色*/ 托普纳夫先生{ 背景色:RGB(12,30,60); 溢出:隐藏; } /*设置导航栏内链接的样式*/ .topnav a{ 浮动:左; 颜色:#F2F2; 文本对齐:居中; 填充:14px 16px; 文字装饰:无; 字体大小:15px; 字体系列:“Gill Sans MT” } /*更改悬停时链接的颜色*/ .topnav a:悬停{ 背景色:#ddd; 颜色:黑色; } /*向活动/当前链接添

我有一个问题,多个ID与CSS不工作

这是我的完整代码:


/*向顶部导航添加黑色背景色*/
托普纳夫先生{
背景色:RGB(12,30,60);
溢出:隐藏;
}
/*设置导航栏内链接的样式*/
.topnav a{
浮动:左;
颜色:#F2F2;
文本对齐:居中;
填充:14px 16px;
文字装饰:无;
字体大小:15px;
字体系列:“Gill Sans MT”
}
/*更改悬停时链接的颜色*/
.topnav a:悬停{
背景色:#ddd;
颜色:黑色;
}
/*向活动/当前链接添加颜色*/
.topnav a.active{
背景色:RGB(255192,0);
颜色:白色;
}
#标题
{
文本对齐:居中;
字体大小:14px;
字体系列:“Gill Sans MT”;
边缘顶部:30px;
}​
#种皮
{
文本对齐:居中;
字体大小:14px;
字体系列:“Gill Sans MT”;
边缘顶部:30px;
}​
本财政年度“研究资助(公开募捐)”申请的时间序列,以及前三个“布林带”申请的时间序列。
本财政年度“研究资助(公开募捐)”申请的时间序列,以及前三个“布林带”申请的时间序列。

如果您有隐藏字符,请删除它们,它将正常工作


/*向顶部导航添加黑色背景色*/
托普纳夫先生{
背景色:RGB(12,30,60);
溢出:隐藏;
}
/*设置导航栏内链接的样式*/
.topnav a{
浮动:左;
颜色:#F2F2;
文本对齐:居中;
填充:14px 16px;
文字装饰:无;
字体大小:15px;
字体系列:“Gill Sans MT”
}
/*更改悬停时链接的颜色*/
.topnav a:悬停{
背景色:#ddd;
颜色:黑色;
}
/*向活动/当前链接添加颜色*/
.topnav a.active{
背景色:RGB(255192,0);
颜色:白色;
}
#标题
{
文本对齐:居中;
字体大小:14px;
字体系列:“Gill Sans MT”;
边缘顶部:30px;
}
#种皮
{
文本对齐:居中;
字体大小:14px;
字体系列:“Gill Sans MT”;
边缘顶部:30px;
}
本财政年度“研究资助(公开募捐)”申请的时间序列,以及前三个“布林带”申请的时间序列。
本财政年度“研究资助(公开募捐)”申请的时间序列,以及前三个“布林带”申请的时间序列。

如果您有隐藏字符,请删除它们,它将正常工作


/*向顶部导航添加黑色背景色*/
托普纳夫先生{
背景色:RGB(12,30,60);
溢出:隐藏;
}
/*设置导航栏内链接的样式*/
.topnav a{
浮动:左;
颜色:#F2F2;
文本对齐:居中;
填充:14px 16px;
文字装饰:无;
字体大小:15px;
字体系列:“Gill Sans MT”
}
/*更改悬停时链接的颜色*/
.topnav a:悬停{
背景色:#ddd;
颜色:黑色;
}
/*向活动/当前链接添加颜色*/
.topnav a.active{
背景色:RGB(255192,0);
颜色:白色;
}
#标题
{
文本对齐:居中;
字体大小:14px;
字体系列:“Gill Sans MT”;
边缘顶部:30px;
}
#种皮
{
文本对齐:居中;
字体大小:14px;
字体系列:“Gill Sans MT”;
边缘顶部:30px;
}
本财政年度“研究资助(公开募捐)”申请的时间序列,以及前三个“布林带”申请的时间序列。
本财政年度“研究资助(公开募捐)”申请的时间序列,以及前三个“布林带”申请的时间序列。

@ScoutEU我想你在评论时可能忘了再添加一个。检查这个,我做了一些改变,可能对你有帮助


/*向顶部导航添加黑色背景色*/
托普纳夫先生{
背景色:RGB(12,30,60);
溢出:隐藏;
}
/*设置导航栏内链接的样式*/
.topnav a{
浮动:左;
颜色:#F2F2;
文本对齐:居中;
填充:14px 16px;
文字装饰:无;
字体大小:15px;
字体系列:“Gill Sans MT”
}
/*更改悬停时链接的颜色*/
.topnav a:悬停{
背景色:#ddd;
颜色:黑色;
}
/*向活动/当前链接添加颜色*/
.topnav a.active{
背景色:RGB(255192,0);
颜色:白色;
}
#标题
{
文本对齐:居中;
字体大小:14px;
字体系列:“Gill Sans MT”;
边缘顶部:30px;
}
#种皮
{
文本对齐:居中;
字体大小:14px;
字体系列:“Gill Sans MT”;
边缘顶部:30px;
}
本财政年度“研究资助(公开募捐)”申请的时间序列,以及前三个“布林带”申请的时间序列。
本财政年度“研究资助(公开募捐)”申请的时间序列,以及前三个“布林带”申请的时间序列。

@ScoutEU我想你在评论时可能忘了再添加一个。检查这个我做了一些改变
#header
{
  text-align: center;
  font-size: 14px;
  font-family: "Gill Sans MT";
  margin-top: 30px;
} /* <-- there is a small plain circle hidden here */
#testa
{
  text-align: center;
  font-size: 14px;
  font-family: "Gill Sans MT";
  margin-top: 30px;
}
<style>
/* Add a black background color to the top navigation */
.topnav {
    background-color:RGB(12,30,60);
    overflow: hidden;
}

/* Style the links inside the navigation bar */
.topnav a {
    float: left;
    color: #f2f2f2;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    font-size: 15px;
    font-family: "Gill Sans MT"
}

/* Change the color of links on hover */
.topnav a:hover {
    background-color: #ddd;
    color: black;
}

/* Add a color to the active/current link */
.topnav a.active {
    background-color: RGB(255,192,0);
    color: white;
}




#header
{
    text-align: center;
    font-size: 14px;
    font-family: "Gill Sans MT";
    margin-top: 30px;
}
#testa
{
    text-align: center;
    font-size: 14px;
    font-family: "Gill Sans MT";
    margin-top: 30px;
}
</style>