C#
HtmlSpan span = Find.ByTagIndex<HtmlSpan>("span", 0);
HtmlWait spanWaitObj = div.Wait;
// Wait for the background color and margin to be set.
// Uses the default timeout value from Settings.Current.ExecuteCommandTimeout
// This form uses GetComputedStyle, which means it follows the CSS chain.
span.Wait.ForStyles("backgroundColor=red", "margin=30px");
// Wait 30 seconds for the background color and margin to be set.
span.Wait.ForStyles(30000, "backgroundColor=red", "margin=30px");
// Wait for the computed style background color and margin to be set
// instead of only examining the styles explicitly set on the element.
// This method will follow the CSS chain up the element list to get
// the currently active style of those specified in the parameters.
span.Wait.ForStyles(true, "backgroundColor=red", "margin=30px");
// Wait 30 seconds for the computed style background color and margin to be set
// instead of only examining the styles explicitly set on the element.
// This method will follow the CSS chain up the element list to get
// the currently active style of those specified in the parameters.
span.Wait.ForStyles(30000, true, "backgroundColor=red", "margin=30px");
// The default timeout value is copied from Settings.Current.ExecuteCommandTimeout
spanWaitObj.Timeout = 1200000; // Override the default value
// Wait 120 seconds for the background color and margin to be set.
spanWaitObj.ForStyles("backgroundColor=red", "margin=30px");
// Wait 120 seconds for for the background color and margin to not be set.
spanWaitObj.ForStylesNot("backgroundColor=red", "margin=30px");
// Wait for both the background color and margin to be not have the specified values.
// Will continue to wait if either style is still set to the specified value.
// Uses the default timeout value from Settings.Current.ExecuteCommandTimeout
span.Wait.ForStylesNot("backgroundColor=red", "margin=30px");