「Spring MVC」form:selectタグのcssClass属性のサンプル

環境
Spring 5.2.4.RELEASE

構文
<form:select cssClass="xxx" path = “xxx">
form:selectタグは、HTMLの<select>タグとその子要素のoptionタグを生成します。
cssClassはHTML標準のclass属性です。

CSSコード

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<style>
.itemSel{width:80%;}
</style>
<style> .itemSel{width:80%;} </style>
<style>
  .itemSel{width:80%;}
</style>

JSPコード

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<form:select cssClass="itemSel" path="userSearchCode">
<form:options items="${userList}" itemLabel="label" itemValue="value"></form:options>
</form:select>
<form:select cssClass="itemSel" path="userSearchCode"> <form:options items="${userList}" itemLabel="label" itemValue="value"></form:options> </form:select>
<form:select cssClass="itemSel" path="userSearchCode">
   <form:options items="${userList}" itemLabel="label" itemValue="value"></form:options>
</form:select>

 

SpringMVC

Posted by arkgame