user3474488 user3474488 - 1 year ago 134
ASP.NET (C#) Question

Change the CSS of the first Argument of @Ajax.ActionLink

is there a way to change the CSS style of only the First argument "Add To Cart" ?
example changing font or color of the Text?

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

Answer Source

Perhaps using pseudo-class in css, first-of-type or first-child. see example

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

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

CSS3 :first-of-type Selector

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download