Skip to content

How can I style nested components? #855

@igor17400

Description

@igor17400

I have a HTML code such as the one below

<p> <img src="image reference" /> </p>

I want to style the image(<img>) tag inside the paragraph (<p>). How can I do it with the style field inside Html widget such as the one below?

Html(
          data: htmlData,
          style: {
            'h1': Style(
                textDecoration: TextDecoration.none,
                fontStyle: FontStyle.normal),
            'p': Style(fontStyle: FontStyle.normal, textAlign: TextAlign.justify),
            'img': Style(
                display: Display.BLOCK,
                margin: EdgeInsets.symmetric(vertical: 15))
          }
) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions