<!DOCTYPE html> <html> <head> <style> div{ border:2px solid black; width:500px; height:170px; } span{ border:2px solid green; width:200px; height:100px; float:right; } </style> </head> <body> <div> <span> This element is floating on the right side. Remove, <b>float:right;</b> to see the effect of float. </span> <p>Although this paragraph is block element but it floats after the span element due to float property of span element.</p> </div> <p><strong>NOTE: </strong> Remove the <b>'float:right;'</b> and see the result.</p> </body> </html>
Run
×
Share