How to centre text ????????????[SOLVED] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to centre text ????????????[SOLVED]

14th Jun 2021, 8:52 AM
Learner
Learner - avatar
13 Answers
+ 9
Use css property text-align: center;
14th Jun 2021, 8:53 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 8
<h1 align = "center"> Anand Raj <h1>
14th Jun 2021, 2:26 PM
Tharul Nejana
Tharul Nejana - avatar
+ 6
<center> i am centered </center>
14th Jun 2021, 9:26 AM
TOLUENE
TOLUENE - avatar
+ 6
Anand Raj why "without CSS"? CSS is the right way: you cannot arg to make web pages without using it nowadays... in fact, <center> is no more part of html since html4: it was deprecated in favor of css 'text-align' to make structure and style much more well organized ^^ from mdn: "Deprecated This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time." https://developer.mozilla.org/en-US/docs/Web/HTML/Element/center
14th Jun 2021, 2:21 PM
visph
visph - avatar
+ 5
There is center tag you can use that
14th Jun 2021, 9:25 AM
YUGRAJ
+ 4
<center> I am in center of the webpage </center> ====================== <div align="center"> Am in center </div> ===================== <div style="text-align: center"> Am also in center </div> ========================= Using CSS..... <style> .center{ text-align: center; } #center{ text-align: center; } </style> <div class="center"> Am in center </div> <div id = "center"> Am also in center </div> ^ = ^ Enjoy
14th Jun 2021, 4:34 PM
MikkyTech
MikkyTech - avatar
+ 3
in html bro with out CSS
14th Jun 2021, 9:08 AM
Learner
Learner - avatar
+ 3
Tharul Nejana as <center> all html features related to styling have been deprecated... you should use css to style element, not attributes... only exception would be the 'style' element wich allow a quick inline-styling, but recommend way iscto use external css files with selectors and rules ^^
14th Jun 2021, 2:29 PM
visph
visph - avatar
+ 1
centre tag doesn't work
15th Jun 2021, 1:32 PM
Learner
Learner - avatar
- 2
For HTML, Use: <center> i am centered </center> For CSS Use this css property text-align: center;
15th Jun 2021, 1:20 PM
Pawan Kumar
- 2
<!—Method 1–> <h1 align=center>Center Text</h1> <!—Method 2–> <center>Center Text</center>
15th Jun 2021, 4:39 PM
Kiran Kamble
Kiran Kamble - avatar
- 4
U can use <center></center> dude
16th Jun 2021, 6:17 AM
Agung Permana Mukti
Agung Permana Mukti - avatar