我正在学习CSS。如何使用CSS样式化输入框和提交按钮?
我正在尝试创建类似于这样的东西,但我不知道该如何实现。
<form action="#" method="post">
Name <input type="text" placeholder="First name"/>
<input type="text" placeholder="Last name"/>
Email <input type="text"/>
Message <input type="textarea"/>
<input type="submit" value="Send"/>
</form>
<input>
标签不支持::after
等样式。 - JamEngulfer<button type="submit"><span>发送</span></button>
。然后可以在span
标签上使用::after
。 - kunambi<button>
上,使用.addEventListener('submit')
将不起作用。提交事件仅在<form>
元素上触发。这可能是为什么OP需要使用表单的原因。请参见:https://dev59.com/Xo_ea4cB1Zd3GeqPLTm8 - Graciela Carrillo