我想编辑表格的输入框,即用户在表格中输入用户名和密码的字段。我已经在php代码中创建了这个表。
现在我想让输入域的文本在不同的颜色,只有小写字母,而不是大写。
我尝试为所选的td提供类,例如class="smallCaps",并尝试在外部css文件中进行编辑,但它不起作用。
<?php
if ($username && $userid){
echo "You have logged in as <b> $username </b>. Click here to <a href='logout.php'> Logout </a>";
}
else {
$form = "<form action= 'index.php' method='POST'>
<table>
<tr> <td> <font color='black' face='arial' size='3'>Username: </font> </font></td> <td> <input type='text' name='user' placeholder='Username' > </td>
<td> <font color='black' face='arial' size='3'>Password: </td> </font><td> <input type='password' name='password' placeholder='Password'></td>
<td> <button type='submit' class='btn' name='loginbtn' value ='Login'><font size='3'>Login</font> </td></button>
<tr><td> <a href='signup.php'> <font color='black' face='arial' size='3'>Register</font> </a> </td> </tr>
</table>
</form>";发布于 2014-03-29 08:25:06
尽量将客户端代码和服务器端代码分开。为此,您可以执行以下操作:
echo '<table class="myClass">';然后将表样式放入您声明的类中
.myClass{
top: 15px;
left: 10px;
}https://stackoverflow.com/questions/22724820
复制相似问题