我使用select2作为下拉选择框,并尝试更改选项的背景色。每个选项都会有单独的颜色。我尝试过在选项中添加一个style属性,但似乎不起作用。 <select class="js-example-basic-multiple form-control" id="select-tags" name="usertags" multiple="multiple">
{% for tag in userTags %}
<option value="{{ tag }}" d
我将标签/标签存储在我的数据库中(如下所示):
labels:
text:string //name of the label/tag
color:string //hex color of the tag (with '#' at the beggining)
我有一些文章,和这些标签有关。我想要在我的文章列表中显示它的标签,但作为一个颜色矩形(在css中编写为带有背景色的块)-但是如何从数据库中设置指定的颜色到每个框的背景色样式?我在:click或:hover之后读到了一些改变站点背景的js函数,但我仍然不知道(我几乎不知道js)如何在我的应用程序中实现它:/请帮助
假设我的页面中有一个框:
<div id="test" style="width:200px; height:200px; background:yellow">
this is a test
</div>
我只在我的页面中包含了"jquery-1.6.2.min.js“
然后我想改变字体大小,所以我使用
$('#test').animate({ fontSize: "10em"}, "slow");
然后我想更改我写的“background-color