必填项前面加个红星,用css来添加,不用html css: <style> span::before{ content: "*"; color: #ff0000; font-size: 25px; position: relative; top: 10px; } </style> <span>必填项</span> 如果把红星加到后面,css写为span::after