Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.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
使用PHP的CSS主动导航高亮显示。下划线工程,颜色不';T为什么?_Php_Html_Css_Colors_Text Decorations - Fatal编程技术网

使用PHP的CSS主动导航高亮显示。下划线工程,颜色不';T为什么?

使用PHP的CSS主动导航高亮显示。下划线工程,颜色不';T为什么?,php,html,css,colors,text-decorations,Php,Html,Css,Colors,Text Decorations,我已经创建了一个活动的导航栏,在您当前使用PHP的页面的链接下方加下划线。我的目标是让链接以不同的颜色加下划线。下划线有效,但颜色不变 我已经定位了.on类,PHP将激活的类,在其他适用的css样式之后,所以我认为没有任何冲突。我甚至试过使用!重要的是要看看这是否有任何影响,但可惜没有 header.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/l

我已经创建了一个活动的导航栏,在您当前使用PHP的页面的链接下方加下划线。我的目标是让链接以不同的颜色加下划线。下划线有效,但颜色不变

我已经定位了.on类,PHP将激活的类,在其他适用的css样式之后,所以我认为没有任何冲突。我甚至试过使用!重要的是要看看这是否有任何影响,但可惜没有

header.php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href='http://fonts.googleapis.com/css?family=Special+Elite' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'>
<!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"> </script><![endif]-->
    <title><?php echo "LWM Marketing"; ?></title>
    <link rel="stylesheet" type="text.css" href="css/style.css"/>
    <link rel="stylesheet" type="text/css" media="all" href="css/reset.css" />
    <link rel="stylesheet" type="text/css" media="all" href="css/text.css" />
    <script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
    <?=@$css;?>
</head>
<body>
    <div class="wrapper">
        <header>
            <a class="header-logo" href="index.php"><h1 id="main-logo">LWM PR &amp; Comms</h1></a>
                <ul class="nav">
                    <li class="<?php if ($section == "index") { echo "on";} ?>"><a href="index.php">About</a></li>
                    <li class="<?php if ($section == "services") { echo "on";} ?>"><a href="services.php">Services and Previous Work</a></li>
                    <li class="<?php if ($section == "contact") { echo "on";} ?>"><a href="contact.php">Contact</a></li>
                </ul>
        </header>
        <div id="content">
}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

}

有人知道为什么颜色属性没有影响吗?它是被我没有注意到的东西所覆盖,还是有我完全忽略的东西


谢谢。

你设计了样式吗?“在”上,这是必需的。

你必须设计实际链接的样式,例如
。在
上,只发布代码的相关部分就不那么粗鲁了。啊哈!真不敢相信我竟然没有想到这一点。奇怪的是下划线仍然有效,不是吗?我已经试过了,很有效,非常感谢!回复也很快。抱歉,我应该从那段特定的代码开始。我只包括了其余部分,因为我不确定是什么导致了这个问题,所以我包括了该页面的所有css和原始html。很抱歉。
#content>*{
width:300px;
#content{
height:1025px;
h2{
font-family: 'Special Elite', helvetica, arial, verdana, sans-serif;
padding-left: 15px;
position: relative;
top:20px;
#linkedin{
position: relative;
top:30px;
left:5px;
#logo-cloud{
position: relative;
left:380px;
top:-150px;
width:600px;
#main-blurb{
font-family: 'Raleway', helvetica, arial, sans-serif;
font-size: 18px;
padding-left: 15px;
position: relative;
top: -125px;
width:600px;
#main-blurb p{
    margin: 0px 0px 40px 40px;
    text-indent: 15px;
    width:600px;
#main-blurb p:last-child{
text-align: center;
font-size: 24px;
#divider{
width:960px;
position: relative;
top:-125px;
left:12px;
border-top-width: 1px;
border-top-style: dashed;
border-top-color: #B6B8BA;
padding-top:15px;
#twitter-timeline{
position: relative;
top:-580px;
left:682px;
footer{
position: relative;
top:-30px;
.hidden{
display:none;
style.css (with the class that the PHP activates)

/* General Styling */

body{
font-family: 'Raleway', helvetica, arial, verdana, sans-serif;
background-image:url("images/paper.png");
}

.wrapper{
width:960px;
margin: auto;
a {
color:#000000;
text-decoration:none;
}

a:hover{
color:#434991;
}

a:active{
color:#FF9436;
}



/* Logo (Header) */

.header-logo{
display:block;
width:247px;
height:111px;
text-indent:-9999px;
background: url("images/logo.gif") no-repeat;
margin:15px 0px 10px 15px;
float:left;
position:relative;
left:40px;
/* Main-Nav */


.nav li{
list-style-type: none;
display:inline-block;
font-size: 23px;
margin-top:90px;
float:left;
position:relative;
left:25px;
top:-12px;
.nav a{
font-family: 'Special Elite', sans-serif;
padding-top:5px;
border-left: 1px dotted #878787 ;
padding:2px 5px 0px 30px;
.nav li:first-child a { 
border: 0; 
.on{
text-decoration:underline;
color:#FF9436;
/* Footer */


footer{
font-family: 'Special Elite', sans-serif;
width:100%;
float:left;
footer p{
display:inline;
footer div{
border-top-width: 1px;
border-top-style: dashed;
border-top-color: #B6B8BA;
padding-top:15px;
footer div li{
list-style-type: none;
display: inline-block;
font-size: 15px;
margin-left: 80px;
footer div li p{
font-size: 12px;