RemoteWebElementGetCssValue Method WebDriver
Gets the value of a CSS property of this element.

Namespace: OpenQA.Selenium.Remote
Assembly: WebDriver (in WebDriver.dll) Version: 3.1.0
Syntax

public string GetCssValue(
	string propertyName
)

Parameters

propertyName
Type: SystemString
The name of the CSS property to get the value of.

Return Value

Type: String
The value of the specified CSS property.

Implements

IWebElementGetCssValue(String)
Exceptions

ExceptionCondition
StaleElementReferenceExceptionThrown when the target element is no longer valid in the document DOM.
Remarks

The value returned by the GetCssValue(String) method is likely to be unpredictable in a cross-browser environment. Color values should be returned as hex strings. For example, a "background-color" property set as "green" in the HTML source, will return "#008000" for its value.
See Also

Reference