Class Source
Generate a standard HTML5 <source> tag
Implements
Inherited Members
Namespace: ToSic.Razor.Html5
Assembly: ToSic.Razor.dll
Syntax
public class Source : Tag<Source>, IRawHtmlString, IHtmlString, IHtmlTag, ITag, IEnumerable<ITag>, IEnumerable
Methods
| Improve this Doc View SourceMedia(String)
Set the media attribute on the <source> tag
Declaration
public Source Media(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | what should be in media='...'. If called multiple times, later values replace the previous value. |
Returns
Type | Description |
---|---|
Source | a Source object to enable fluid command chaining |
Sizes(String)
Set the sizes attribute on the <source> tag
Declaration
public Source Sizes(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | what should be in sizes='...'. If called multiple times, later values replace the previous value. |
Returns
Type | Description |
---|---|
Source | a Source object to enable fluid command chaining |
Src(String)
Set the src attribute on the <source> tag Automatically url-encode it if contains spaces, umlauts or other unexpected chars
Declaration
public Source Src(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | what should be in src='...'. If called multiple times, later values replace the previous value. |
Returns
Type | Description |
---|---|
Source | a Source object to enable fluid command chaining |
Srcset(String)
Set the srcset attribute on the <source> tag Automatically url-encode it if contains spaces, umlauts or other unexpected chars
Declaration
public Source Srcset(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | what should be in srcset='...'. If called multiple times, later values replace the previous value. |
Returns
Type | Description |
---|---|
Source | a Source object to enable fluid command chaining |
Srcset(String, Int32)
Add another name/number pair to the srcset attribute on the <source> tag Automatically url-encode it if contains spaces, umlauts or other unexpected chars
Declaration
public Source Srcset(string name, int multiplier)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | image name |
System.Int32 | multiplier | what the images is for - numbers below 8 are used for resolution densities, larger numbers for pixel widths |
Returns
Type | Description |
---|---|
Source | a Source object to enable fluid command chaining |
Type(String)
Set the type attribute on the <source> tag
Declaration
public Source Type(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | what should be in type='...'. If called multiple times, later values replace the previous value. |
Returns
Type | Description |
---|---|
Source | a Source object to enable fluid command chaining |