@ Html.DropDownListFor;如何设置在DDL每个项目不同的背景颜色? [英] @Html.DropDownListFor; How to set different background color for each item in DDL?

查看:364
本文介绍了@ Html.DropDownListFor;如何设置在DDL每个项目不同的背景颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个下拉列表(@ html.DropDownListFor),其中我显示的颜色名字......我想显示具有单独的背景色..就像,一个项目的绿色应该是绿色的背景每个项目, 黄色,在黄色的背景。

I have a dropdown list (@html.DropDownListFor) wherein I am showing name of colors... I want to display each item having seperate background color.. Like, an item "Green" should be in green background, and "Yellow" in yellow background.

我怎样才能做到这一点?

How can I achieve this?

推荐答案

<一个href=\"http://forums.asp.net/t/1871921.aspx/1?%20Html%20DropDownListFor%20How%20to%20set%20different%20background%20color%20for%20each%20item%20in%20DDL%20\"相对=nofollow>看到这里的ASP.NET论坛解决解决方案

这篇关于@ Html.DropDownListFor;如何设置在DDL每个项目不同的背景颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆