© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•15mo ago•
31 replies
King TMK 🎗

asp attribute span not getting styled like plain span

Why is it that only the plain span is being styled and not the asp span? How can I fix this?

<span class="danger" asp-validation-for="SomeModel.Number"></span>
<span class="danger">some span</span>
<span class="danger" asp-validation-for="SomeModel.Number"></span>
<span class="danger">some span</span>


span.field-validation-error,
.field-validation-error,
.danger,
span {
    background: green;
}

.danger {
    color: yellow;
}
span.field-validation-error,
.field-validation-error,
.danger,
span {
    background: green;
}

.danger {
    color: yellow;
}
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ JSON + ASP.NET attribute usage
C#CC# / help
2y ago
✅ ASP Core Attribute Logic Help
C#CC# / help
2y ago
Asp Net Core Authorize Attribute
C#CC# / help
4y ago
asp-net notation does not recognise attribute notation from a model class
C#CC# / help
11mo ago