html - HTML 中的文本区域显示代码而不是呈现和格式化

标签 html css

我以前做过文本区域,但这个让我很受不了。文本区域显示的是 html 代码,并且没有正确地使用 css。所以在实际的窗口中,我得到了文本区域元素的代码,它也显示了我的其余代码,而不是渲染它。没有 textarea 标签,一切都很好。

<article>
<form method="POST" name="form9" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <label for="firstName">First Name <sup>*</sup></label>
    <input type="text" id="firstName" name="firstName" required />

    <label for="lastName">Last Name <sup>*</sup></label>
    <input type="text" id="lastName" name="lastName"/>

    <label for="wrstyle">Writing Style <sup>*</sup></label>
    <textarea placeholder="Please, briefly describe your writing style." type="text" id="wrstyle" name="wrstyle"</textarea>

    <label for="submit" class="centerit" title="Click here to register your account">
    <input type="submit" name="submit" value="Sign Up" />
                </label>
                <p class="notice"><sup>*</sup> denotes a required field.</p>

</form>
</article>

最佳答案

您没有关闭文本区域的开始标记(您缺少 > ):

http://jsfiddle.net/Bvk92/

还值得注意的是 <textarea> has no type attribute.

关于html - HTML 中的文本区域显示代码而不是呈现和格式化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16074998/

相关文章:

javascript - 如何修复 split() undefined 和 onclick 事件上出现错误的 Javascript 代码?

javascript - CSS:图像边距留下空白

html - 如何在移动版本中编辑文本的 css margin-top

javascript - 图片库中的图片定位

html - 如何设置输入的背景透明度?

html - 区 block 高度是个问题——我尝试了所有方法,但 :(

JavaScript:按类单击元素不起作用

javascript - 如何在 Bootstrap 中垂直对齐输入元素?

html - 覆盖类属性

javascript - Css 文本定位无法正常工作