Aright-alignedparagraph.

&"/> Aright-alignedparagraph.

&">

Home  >  Article  >  Web Front-end  >  How can we set alignment based on surrounding elements in HTML?

How can we set alignment based on surrounding elements in HTML?

王林
王林forward
2023-08-28 15:09:18574browse

How can we set alignment based on surrounding elements in HTML?

Use the align property to set the alignment. You can try running the following code to implement the align attribute in HTML -

Note - The align attribute is deprecated in HTML5. Please use CSS instead.

Example

<!DOCTYPE html>
<html>
   <body>
      <p align="right">A right-aligned paragraph.</p>
      <p><b>Note:</b> The align attribute is not supported in HTML5. Use CSS instead.</p>
   </body>
</html>

The above is the detailed content of How can we set alignment based on surrounding elements in HTML?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete