hey folks. i got this website. in which i can’t center the text coming soon and footer. where am i going wrong. am i missing something?
When you want to center (inline) text who sits inside a block element (like your “p” or your "div id=“footer”) then give those elements “text-align: center”.
Automargins only center unfloated block elements whose widths are less than 100%.
to be more precise, and mathematical,an element whose with is 100% is already centered … (0 space to left and right) if you have an element that is not floated and has a specific width that is less than the view port, it is placed at the left by default. margin:0 auto adds an equal amount of margin on both left and right of the element and thus centers it.
Note this is all happening to the element , not the text or content inside it. if you wanted to center text, or an img that’s withing a block element ( best if it’s by itself , otherwise it will center the text in that block element) use “text-align:center”