Different use of 'float' in javascript


For inline float style detection in the <body> elements only !

Example 1

[get] element.style.float

<p style="float: right">...</p>

get style

Result.....:    

Example 2

[get] element.style.cssFloat

<p style="float: right">...</p>

get style

Result.....:    


Setting inline float styles in the <body> elements

Example 3

[set] element.style.float

<p>...</p>

set style

Example 4

[set] element.style.cssFloat

<p>...</p>

set style


For external stylesheets, style blocks in the <>head> and inline-styles as well

Example 5

window.getComputedStyle(element).getPropertyValue("float")

floating right by stylesheet

get style

Result.....:    

Example 6

window.getComputedStyle(element).getPropertyValue("cssFloat")

floating right by stylesheet

get style

Result.....:    

Example 7

window.getComputedStyle(element).getPropertyValue("css-float")

floating right by stylesheet

get style

Result.....:    


Remarks

Francky Kleyneman, 10 jan. 2019