• Home
  • Articles
  • API Documentation
  • API Documentation
  • ToSic.Razor.Html5
  • Img
Search Results for

    Show / Hide Table of Contents
    • ToSic.Razor.Blade
      • IHtmlTag
      • IHtmlTagsService
      • IScrub
      • Tag
      • Tags
      • Text
    • ToSic.Razor.Html5
      • A
      • Abbr
      • Address
      • Area
      • Article
      • Aside
      • Audio
      • B
      • Base
      • Bdi
      • Bdo
      • Blockquote
      • Br
      • Button
      • Canvas
      • Caption
      • Cite
      • Code
      • Col
      • Colgroup
      • Comment
      • Data
      • Datalist
      • Dd
      • Del
      • Details
      • Dfn
      • Dialog
      • Div
      • Dl
      • Dt
      • Em
      • Embed
      • Fieldset
      • Figcaption
      • Figure
      • Footer
      • Form
      • H1
      • H2
      • H3
      • H4
      • H5
      • H6
      • Head
      • Header
      • Hr
      • I
      • Icon
      • Iframe
      • Img
      • Input
      • Ins
      • Kbd
      • Label
      • Legend
      • Li
      • Link
      • Main
      • Map
      • Mark
      • Meta
      • MetaOg
      • Meter
      • Nav
      • Noscript
      • Object
      • Ol
      • Optgroup
      • Option
      • Output
      • P
      • Param
      • Picture
      • Pre
      • Progress
      • Q
      • Rp
      • Rt
      • Ruby
      • S
      • Samp
      • Script
      • ScriptJsonLd
      • Section
      • Select
      • Small
      • Source
      • Span
      • Strong
      • Style
      • Sub
      • Summary
      • Sup
      • Svg
      • Table
      • Tbody
      • Td
      • Template
      • Textarea
      • Tfoot
      • Th
      • Thead
      • Time
      • Tr
      • Track
      • U
      • Ul
      • Var
      • Video
      • Wbr
    • ToSic.Razor.Markup
      • Attribute
      • AttributeOptions
      • Attributes
      • ITag
      • Tag<T>
      • TagBase
      • TagChildren
      • TagCustom
      • TagList
      • TagOptions
      • TagText
    • ToSic.Razor.StartUp
      • StartUp

    Class Img

    Generate a standard HTML5 <img> tag

    Inheritance
    System.Object
    ToSic.Razor.Markup.RawHtmlString
    TagBase
    Tag<Img>
    Img
    Implements
    System.Web.IHtmlString
    IHtmlTag
    ITag
    System.Collections.Generic.IEnumerable<ITag>
    System.Collections.IEnumerable
    Inherited Members
    Tag<Img>.Attr(String, Object, String)
    Tag<Img>.Attr(Object)
    Tag<Img>.Id(String)
    Tag<Img>.Class(String)
    Tag<Img>.Style(String)
    Tag<Img>.Title(String)
    Tag<Img>.Data(String, Object)
    Tag<Img>.On(String, Object)
    Tag<Img>.Add(Object[])
    Tag<Img>.Wrap(Object[])
    Tag<Img>.AsHtmlTag()
    TagBase.IsImmutable
    TagBase.PreProcessNewChild(Object)
    TagBase.ApplyChanges(CloneChanges)
    TagBase.TagName
    TagBase.TagOptions
    TagBase.ToString()
    TagBase.TagAttributes
    TagBase.TagChildren
    TagBase.TagStart
    TagBase.TagEnd
    Namespace: ToSic.Razor.Html5
    Assembly: ToSic.Razor.dll
    Syntax
    public class Img : Tag<Img>, IRawHtmlString, IHtmlString, IHtmlTag, ITag, IEnumerable<ITag>, IEnumerable

    Methods

    | Improve this Doc View Source

    Alt(String)

    Set the alt attribute on the <img> tag

    Declaration
    public Img Alt(string value)
    Parameters
    Type Name Description
    System.String value

    what should be in alt='...'. If called multiple times, later values replace the previous value.

    Returns
    Type Description
    Img

    a Img object to enable fluid command chaining

    | Improve this Doc View Source

    Crossorigin(String)

    Set the crossorigin attribute on the <img> tag

    Declaration
    public Img Crossorigin(string value)
    Parameters
    Type Name Description
    System.String value

    what should be in crossorigin='...'. If called multiple times, later values replace the previous value.

    Returns
    Type Description
    Img

    a Img object to enable fluid command chaining

    | Improve this Doc View Source

    Height(Int32)

    Set the height attribute on the <img> tag

    Declaration
    public Img Height(int value)
    Parameters
    Type Name Description
    System.Int32 value

    what should be in height='...'. If called multiple times, later values replace the previous value.

    Returns
    Type Description
    Img

    a Img object to enable fluid command chaining

    | Improve this Doc View Source

    Height(String)

    Set the height attribute on the <img> tag

    Declaration
    public Img Height(string value)
    Parameters
    Type Name Description
    System.String value

    what should be in height='...'. If called multiple times, later values replace the previous value.

    Returns
    Type Description
    Img

    a Img object to enable fluid command chaining

    | Improve this Doc View Source

    Longdesc(String)

    Set the longdesc attribute on the <img> tag

    Declaration
    public Img Longdesc(string value)
    Parameters
    Type Name Description
    System.String value

    what should be in longdesc='...'. If called multiple times, later values replace the previous value.

    Returns
    Type Description
    Img

    a Img object to enable fluid command chaining

    | Improve this Doc View Source

    Sizes(String)

    Set the sizes attribute on the <img> tag

    Declaration
    public Img 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
    Img

    a Img object to enable fluid command chaining

    | Improve this Doc View Source

    Src(String)

    Set the src attribute on the <img> tag Automatically url-encode it if contains spaces, umlauts or other unexpected chars

    Declaration
    public Img 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
    Img

    a Img object to enable fluid command chaining

    | Improve this Doc View Source

    Srcset(String)

    Set the srcset attribute on the <img> tag Automatically url-encode it if contains spaces, umlauts or other unexpected chars

    Declaration
    public Img 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
    Img

    a Img object to enable fluid command chaining

    | Improve this Doc View Source

    Srcset(String, Int32)

    Add another name/number pair to the srcset attribute on the <img> tag Automatically url-encode it if contains spaces, umlauts or other unexpected chars

    Declaration
    public Img 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
    Img

    a Img object to enable fluid command chaining

    | Improve this Doc View Source

    Usemap(String)

    Set the usemap attribute on the <img> tag

    Declaration
    public Img Usemap(string value)
    Parameters
    Type Name Description
    System.String value

    what should be in usemap='...'. If called multiple times, later values replace the previous value.

    Returns
    Type Description
    Img

    a Img object to enable fluid command chaining

    | Improve this Doc View Source

    Width(Int32)

    Set the width attribute on the <img> tag

    Declaration
    public Img Width(int value)
    Parameters
    Type Name Description
    System.Int32 value

    what should be in width='...'. If called multiple times, later values replace the previous value.

    Returns
    Type Description
    Img

    a Img object to enable fluid command chaining

    | Improve this Doc View Source

    Width(String)

    Set the width attribute on the <img> tag

    Declaration
    public Img Width(string value)
    Parameters
    Type Name Description
    System.String value

    what should be in width='...'. If called multiple times, later values replace the previous value.

    Returns
    Type Description
    Img

    a Img object to enable fluid command chaining

    Implements

    System.Web.IHtmlString
    IHtmlTag
    ITag
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • Alt(String)
      • Crossorigin(String)
      • Height(Int32)
      • Height(String)
      • Longdesc(String)
      • Sizes(String)
      • Src(String)
      • Srcset(String)
      • Srcset(String, Int32)
      • Usemap(String)
      • Width(Int32)
      • Width(String)
    • Implements
    Back to top Generated by DocFX