I understand what the asp-fallback-* tag helpers do. What I don\'t understand is how.
For example:
TL;DR:
tag is added to the DOM that has a CSS class of sr-only. element.position that is set to absolute. element is written to the DOM with a href of ~/lib/bootstrap/dist/css/bootstrap.min.css.The LinkTagHelper class that runs against your elements inserts a element in the output HTML that is given a CSS class of sr-only. The element ends up looking like this:
The code that generates the element looks like this (source):
builder
.AppendHtml("");
Unsurprisingly, the value for FallbackTestClass is obtained from the 's asp-fallback-test-class attribute.
Right after this element is inserted, a corresponding block is also inserted (source). The code for that starts off like this:
// Build the tag that checks the effective style of tag above and renders the extra
// tag to load the fallback stylesheet if the test CSS property value is found to be false,
// indicating that the primary stylesheet failed to load.
// GetEmbeddedJavaScript returns JavaScript to which we add '"{0}","{1}",{2});'
builder
.AppendHtml("