# `Premailex.HTMLInlineStyles`
[🔗](https://github.com/danschultzer/premailex/blob/v1.0.1/lib/premailex/html_inline_styles.ex#L1)

Inlines CSS styles into a `t:Premailex.html_tree/0`.

# `process`

```elixir
@spec process(Premailex.html_tree(), [Premailex.CSSParser.rule()]) ::
  Premailex.html_tree()
```

Adds inline styles from CSS rules (`t:CSSParser.rule/0`) to a
`t:Premailex.html_tree/0`.

## Examples

    iex> tree = Premailex.parse(~s(<html><head><style>p{background-color: #fff;}</style></head><body><p style="color: #000;">Text</p></body></html>))
    iex> css_rules = Premailex.CSSParser.parse("p{background-color: #fff;}")
    iex> Premailex.HTMLInlineStyles.process(tree, css_rules)
    [
      {"html", [],
      [
        {"head", [], [{"style", [], ["p{background-color: #fff;}"]}]},
        {"body", [], [{"p", [{"style", "background-color: #fff; color: #000;"}], ["Text"]}]}
      ]}
    ]

---

*Consult [api-reference.md](api-reference.md) for complete listing*
