How do we set the alignment according to surrounding elements in HTML?

HTMLWeb DevelopmentFront End Technology

Use the align attribute to set the alignment. You can try to run the following code to implement align attribute in HTML −

Note − The align attribute deprecated in HTML5. Use CSS instead.


<!DOCTYPE html>
      <p align="right">A right-aligned paragraph.</p>
      <p><b>Note:</b> The align attribute is not supported in HTML5. Use CSS instead.</p>
Published on 13-Mar-2018 11:36:39