- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How do we set the alignment according to surrounding elements in HTML?
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.
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>
Advertisements