【发布时间】:2015-01-18 20:59:06
【问题描述】:
我正在尝试将一些 CSS 嵌入到我的 PHP 文件中。如何正确添加我的 CSS,以便每个调用的表单都呈现在黑色边框内?这是我到目前为止所尝试的。
while ($ratings = mysql_fetch_array($q))
{
//This outputs the doctors's name
echo "Doctor's name:" . $ratings['doctor_name'] ."<br />";
// Retrieve the id of the doctor which was posted on
$id = $_POST['id'];
echo "<style> form { border-style: solid; border-color: #ffffff}";
//This outputs a textarea for the user to submit comments
echo "<b>Your Experience: </b>";
echo "<form method='post' action='review_doctors.php'>
<textarea name='body'></textarea>
<input type='submit' name='submit' value='Send'/>
<input type='hidden' name='id' value='$ratings[id]' />
</style>
</form>
";
echo "<br />";
}
【问题讨论】:
-
为什么要将表单包装在样式标签中?样式标签应该只包含样式。
-
然后您的样式标签在
form之前终止。这会杀死 HTML。