driodev driodev - 2 years ago 139
CSS Question

Edit CSS using Dart

Can I edit a HTML-tag's CSS using DART?

I have done some searching but I couldn't really find out how to do it, or if it even is possible.

The reason to do this because I would like to change a button's location on a page.

Answer Source

You can change or view css properties through Element.style. The Element.style is an instance of CssStyleDeclaration. You can do the following:

Element element = document.querySelector("div")
  ..style // edit any of the properties of this variable
  ..style.background = "orange";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download