How to centre text ????????????[SOLVED] | Sololearn: Learn to code for FREE!


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

6/14/2021 8:52:16 AM


15 Answers

New Answer


Use css property text-align: center;


<h1 align = "center"> Anand Raj <h1>


<center> i am centered </center>


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


There is center tag you can use that



<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


in html bro with out CSS


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 ^^


centre tag doesn't work


You can simply center the text by both html and css By html you will the tag <center> word</center> By css text-align: center;


For HTML, Use: <center> i am centered </center> For CSS Use this css property text-align: center;


<!—Method 1–> <h1 align=center>Center Text</h1> <!—Method 2–> <center>Center Text</center>


U can use <center></center> dude