How do i align center | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

How do i align center

29th Apr 2019, 6:41 PM
Remi Israel
7 Answers
+ 11
29th Apr 2019, 7:58 PM
JTLZ
+ 7
In HTML, there is an attribute called align. This attribute accepts one of three values: - left - center - right ----- It actually depends on what you want to align. I would suggest, just for safety, that you do the following: <div align="center"> <!-- Code goes here --> </div> The reason for the above is because if you want an image to be aligned, you can't add align to the <img> tag.
29th Apr 2019, 6:50 PM
Edwin Pratt
Edwin Pratt - avatar
+ 2
CSS Pro Tips : Centering Elements by Domino https://www.sololearn.com/post/37760/?ref=app
30th Apr 2019, 1:41 AM
Gordon
Gordon - avatar
+ 1
Edwin Pratt please use CSS for styling.
30th Apr 2019, 1:42 AM
Gordon
Gordon - avatar
0
هلو
1st May 2019, 9:12 AM
محسن كريزمن
محسن كريزمن - avatar
0
Thanks all
1st May 2019, 11:57 AM
Remi Israel
0
you can either use the html way (align="center") or the css way (style="text-align: center;"). Both of these are added as attributes.
11th Dec 2019, 3:44 AM
Joshua