更改@ Ajax.ActionLink的第一个Argument的CSS

时间:2014-11-13 01:49:03

标签: css asp.net razor

有没有办法只更改第一个参数“添加到购物车”的CSS样式? 示例更改文本的字体或颜色?

@Ajax.ActionLink( "Add To Cart", "addToCart", "Product", new { idProduct = @item.idProduct, quantity = 1 }, new AjaxOptions { HttpMethod = "POST", }, new { @class = "item-add-btn" } ) 

1 个答案:

答案 0 :(得分:0)

也许在css,first-of-type或first-child中使用伪类。见例子

li:first-of-type {
  background-color: yellow;
}

li:first-child {
  background-color: yellow;
} 

CSS3 :first-of-type Selector