how do i make my headings or text be centered? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

how do i make my headings or text be centered?

10th Feb 2017, 11:40 PM
njabulo
njabulo - avatar
2 Answers
+ 1
HTML: <h1 class="hd1">HEADING</h1> CSS: hd1{text-align:center;}
11th Feb 2017, 4:38 AM
Chandan Kumar Y S
Chandan Kumar Y S - avatar
0
To make your text become center in css you can use text-align:center; You can use inline, external or internal css to do so. inline css: <h1 style="text-align:center">Center</h1> external css: h1 { text-align:center; } works inside a seperate css file! internal css: <style> h1 { text-align:center; } </style> works inside html within the style tag!
11th Feb 2017, 12:37 AM
David Oats
David Oats - avatar