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.
<!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!