HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <style> img{ width: 125px; height: 100px; } </style> </head> <body> <h1>CSS float Property</h1> <img src="car-left.png"> <p> This is a paragraph.</p> <button onclick="myFunction()">Click Me</button> <script> var x = document.getElementsByTagName("img")[0]; function myFunction(){ x.style.float = "right"; } </script> <p><strong>Note</strong>: click on the button to change the 'float' from none to right.</p> </body> </html>
OUTPUT
×

Save as Private