Search code examples
htmlcssjspstruts2struts-tags

How can I config Struts2 color of requiredLabel


<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                      "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Employee List</title>

</head>
<body>
    <s:form>

         <s:select list="{'14001','14002'}" label="EmployeeID"
            cssStyle="width:150px" name="empname" requiredLabel="true" /> 

         <s:submit />

    </s:form>
</body>

I want to get the asterisk (*) in red color. How can I make this happen.


Solution

  • <style>
        /* all "*" spans */
        label > span {
            color: red;
        }
    </style>
    

    More info on this answer.