无论我如何奇怪地尝试我的表单,并且感谢你将两个php文件分别用嵌入字体着色和一个外部样式表拒绝改变黑色字体颜色。
谢谢你的php文件: http://www.richiesportfolio.com/contact/thank-you.php联系表格php文件: http://www.richiesportfolio.com/contact/contactform.php
其他所有内容都可以正常工作,但更改联系人表单字体颜色
contactform.php
`
<?PHP
require_once("./include/fgcontactform.php");
$formproc = new FGContactForm();
if(isset($_POST['submitted']))
{
if($formproc->ProcessForm())
{
$formproc->RedirectToURL("thank-you.php");
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>Contact us</title>
<link rel="stylesheet" type="text/css" href="http://www.richiesportfolio.com/contact/contact.css" />
<script type='text/javascript' src='scripts/gen_validatorv31.js'></script>
</head>
<body>
<!-- Form Code Start -->
<form id='contactus' action='<?php echo $formproc->GetSelfScript(); ?>' method='post' accept-charset='UTF-8'>
<fieldset >
<legend>Contact Me</legend>
<input type='hidden' name='submitted' id='submitted' value='1'/>
<input type='hidden' name='<?php echo $formproc->GetFormIDInputName(); ?>' value='<?php echo $formproc->GetFormIDInputValue(); ?>'/>
<input type='text' class='spmhidip' name='<?php echo $formproc->GetSpamTrapInputName(); ?>' />
<div class='short_explanation'>* required fields</div>
<div><span class='error'><?php echo $formproc->GetErrorMessage(); ?></span></div>
<div class='container'>
<label for='name' >Your Full Name*: </label><br/>
<input type='text' name='name' id='name' value='<?php echo $formproc->SafeDisplay('name') ?>' maxlength="50" /><br/>
<span id='contactus_name_errorloc' class='error'></span>
</div>
<div class='container'>
<label for='email' >Email Address*:</label><br/>
<input type='text' name='email' id='email' value='<?php echo $formproc->SafeDisplay('email') ?>' maxlength="50" /><br/>
<span id='contactus_email_errorloc' class='error'></span>
</div>
<div class='container'>
<label for='message' >Message:</label><br/>
<span id='contactus_message_errorloc' class='error'></span>
<textarea rows="10" cols="50" name='message' id='message'><?php echo $formproc->SafeDisplay('message') ?></textarea>
</div>
<div class='container'>
<input type='submit' name='Submit' value='Submit' />
</div>
</fieldset>
</form>
<!-- client-side Form Validations:
Uses the excellent form validation script from JavaScript-coder.com-->
<script type='text/javascript'>
// <![CDATA[
var frmvalidator = new Validator("contactus");
frmvalidator.EnableOnPageErrorDisplay();
frmvalidator.EnableMsgsTogether();
frmvalidator.addValidation("name","req","Please provide your name");
frmvalidator.addValidation("email","req","Please provide your email address");
frmvalidator.addValidation("email","email","Please provide a valid email address");
frmvalidator.addValidation("message","maxlen=2048","The message is too long!(more than 2KB!)");
// ]]>
</script>
</body>
</html>`
contact.css
body,table,tr,td,a,p,h1,h2,h3,h4,h5,input,h3 a,h4 a,h5 ul, li, ul, a {
color:#FFF;
}
#contactus fieldset {
width:320px;
padding:20px;
border:20px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
-khtml-border-radius: 10px; border-radius: 10px;
}
#contactus legend, h2 {
font-family : Arial, sans-serif;
font-size:1.3em;
font-weight:bold;
color:#FFF;
}
#contactus label {
font-family : Arial, sans-serif;
font-size:0.8em;
font-weight: bold;
color:#FFF;
}
#contactus input[type="text"],textarea {
font-family : Arial, Verdana, sans-serif; font-size: 0.8em;
line-height:140%;
color : #000;
padding : 3px;
border : 1px solid;
#999;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-khtml-border-radius: 5px;
border-radius: 5px;
}
#contactus input[type="text"] {
height:18px;
width:220px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
#contactus #scaptcha {
width:60px;
height:18px;
}
#contactus input[type="submit"] {
width:100px;
height:30px;
padding-left:0px;
-webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; }
#contactus textarea {
height:120px;
width:310px;
-webkit-border-radius:8px;
-moz-border-radius: 8px;
border-radius: 8px;
}
#contactus input[type="text"]:focus,textarea:focus {
color : #009;
border : 1px solid #990000;
background-color : #ffff99;
font-weight:bold;
}
#contactus .container {
margin-top:8px;
margin-bottom:10px;
color:#FFF;
}
#contactus .error {
font-family: Verdana, Arial, sans-serif;
font-size: 0.7em; color: #900;
background-color : #111;
}
#contactus fieldset#antispam {
padding:2px;
border-top:1px solid #EEE;
border-left:0;
border-right:0;
border-bottom:0;
width:350px; }
#contactus fieldset#antispam legend {
font-family : Arial, sans-serif;
font-size: 0.8em;
font-weight:bold;
color:#FFF;
}
#contactus .short_explanation {
font-family : Arial, sans-serif;
font-size: 0.6em;
color:#FFF;
}
/* spam_trap: This input is hidden. This is here to trick the spam bots*/
#contactus .spmhidip {
display:none;
width:10px;
height:3px;
}
#fg_crdiv {
font-family : Arial, sans-serif;
font-size: 0.3em;
opacity: .2;
-moz-opacity: .2;
filter: alpha(opacity=20);
}
#fg_crdiv p {
display:none;
}
答案 0 :(得分:4)
在感谢页面上,您在font:#fff;
属性中使用了style
。将其更改为color: #fff;
。
联系页面中的标签未指定颜色,因此它从指定颜色的最近父级继承。为指定color: #fff
。