下面是我的html代码的一部分,但h1标记的css似乎不起作用。什么似乎是问题?
h1 {
font-size: 20px;
color: #445668;
text-transform: uppercase;
text-align: center;
margin: 0 0 35px 0;
text-shadow: 0px 1px 0px #f2f2f2;
}
</style>
</head>
<body>
<div id="box">
<form id="truth">
<h1> Truth </h1>
First Name: <input type="text" name="firstname" maxlength="30" /> <br>
Last Name: <input type="text" name="lastname" maxlength="30"/> <br>
Email: <input type="text" id="email" /> <br>
Male <input type="radio" name="gender" value="male"/>
Female <input type="radio" name="gender" value="female"/> <br>
Date to be performed:<input type="date" name="date"/><br>
Victim: <input type="text" name="victim" maxlength="30" />
<input type="submit" onclick="validateEmail();" />
</form>
</div>
</body>
</html>
答案 0 :(得分:0)
试试这段代码:
<html>
<style>
h1 {
font-size: 20px;
color: red;
text-transform: uppercase;
text-align: center;
margin: 0 0 35px 0;
text-shadow: 0px 1px 0px #f2f2f2;
}
</style>
</head>
<body>
<div id="box">
<form id="truth">
<h1> Truth </h1>
First Name: <input type="text" name="firstname" maxlength="30" /> <br>
Last Name: <input type="text" name="lastname" maxlength="30"/> <br>
Email: <input type="text" id="email" /> <br>
Male <input type="radio" name="gender" value="male"/>
Female <input type="radio" name="gender" value="female"/> <br>
Date to be performed:<input type="date" name="date"/><br>
Victim: <input type="text" name="victim" maxlength="30" />
<input type="submit" onclick="validateEmail();" />
</form>
</div>
</body>
</html>
答案 1 :(得分:0)
尝试#box h1 {“your style”}或#box #truth h1 {“your style”}
答案 2 :(得分:0)
问题在于您的源代码的字符编码,不知道您是如何编写的,而是复制到记事本中并重新键入行&#34; color:#445668;&#34;解决了这个问题。猜测你是在Windows机器上编辑linux代码,反之亦然。