如何将我的php错误文本的颜色和字体等属性更改为屏幕?
function output_errors($errors) {
return '<ul><li>' . implode('</li><li>', $errors) . '</li></ul>';
}
if
(empty($username) === true || empty($password) === true) {
$errors[] = 'You need to enter a password and username!';
}
答案 0 :(得分:4)
只需使用带内联样式的HTML标记即可获得最快捷的方法。为了更加一致,请将类应用于包装HTML标记并在CSS类中定义样式。
看到@ Fred的编辑后,您可能会这样做:
return '<ul style="color:red;"><li>' . implode ('</li><li>', $errors) . '</li></ul>';