我想编辑表格的输入框,即用户在表格中输入用户名和密码的字段。我已经在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 07:28:21
我不知道你在这里做什么。是否包含外部css文件?
我假设你做的是class='smallCaps‘,而不是class="smallCaps“,这会与echo冲突。
发布于 2014-03-29 07:34:34
您应该尝试像这样的内联样式:
<table style=" background-repeat:no-repeat; width:450px;margin:0;" cellpadding="0" cellspacing="0" border="0">
<tr style="height:40px; width:450px; margin:0;">
<td style="height:40px; width:40px; margin:0;">等等……
发布于 2014-03-29 08:25:06
尽量将客户端代码和服务器端代码分开。为此,您可以执行以下操作:
echo '<table class="myClass">';然后将表样式放入您声明的类中
.myClass{
top: 15px;
left: 10px;
}https://stackoverflow.com/questions/22724820
复制相似问题