Blazor adds random attributes

Kuler Master 386 Reputation points
2025-01-02T11:02:55.0933333+00:00

Hello guys and all the best for the new year

BlazorWeirdAttribute3

I am struggling with these strange attributes that Blazor keeps adding to all elements. I tried to find more about this behavior but none of the proposed solutions worked for me. For instance, MS suggests disabling of scoped CSS bundling. Well, I tried but I am still having those attributes.

<PropertyGroup>
  <DisableScopedCssBundling>true</DisableScopedCssBundling>
</PropertyGroup>

Actually, I don't mind, but the W3 validator complains about them.

Thank you in advance

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,724 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,643 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,555 questions
{count} votes

Accepted answer
  1. AgaveJoe 29,121 Reputation points
    2025-01-02T11:18:20.03+00:00

    I am struggling with these strange attributes that Blazor keeps adding to all elements. I tried to find more about this behavior but none of the proposed solutions worked for me.

    The b-[10 digits] is generated by Blazor CSS isolation and covered in the official documentation.

    https://learn.microsoft.com/en-us/aspnet/core/blazor/components/css-isolation?view=aspnetcore-9.0

    I also tried to disable the Scoped Css but then some elements lost the style.

    It is not clear what styles were lost or the elements that lost the style but I assume you need to apply a style to those elements. You can use a separate style sheet or inline.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.