applying a css class to core asp-controller anchor tag

maqskywalker used Ask the Experts™
I have a Asp.Net Core Application.

On one of my views I have an anchor tag like this this.

<a asp-controller="Speaker"
   asp-action="Index">All Speakers</a>

i have a CSS class that looks like this:

.LinkStyle1 a:link { color: #0000FF; }

Is there a way to add this class style to the asp-controller link tag?

One way that works is like this:

<span class=“LinkStyle1”><a asp-controller="Speaker"
   asp-action="Index">All Speakers</a></span>

Is there a better way to apply a css class to this asp-controller tag?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Software Engineer
Top Expert 2009
IF your intention is to change only some of your links, then you approach is the correct one.

Note: Otherwise for all links in your page you should use:
a:link { color: #0000FF; }

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial