Now the real power start: using the Wrap
method, you can add more content to your tag - and this can be both text, more Tag
objects or even lists of Tag
objects. Wrap always replaces the content, and you could also use Add(...)
instead to append stuff.
⬇️ Result | Source ➡️
Did you know, that you can add text...
and tags
as well as more tags and strings inside it?
@inherits Custom.Hybrid.RazorTyped
@using ToSic.Razor.Blade
@{
var darkBox = Tag.Div()
.Class("alert alert-dark")
.Wrap(
"Did you know, that you can add text...",
Tag.Code("and tags"),
Tag.Div(
"as well as more ",
Tag.B("tags"),
" and strings inside it?"
)
.Class("alert")
.Class("alert-danger")
);
}
@darkBox