I have some text in html. About 2 paragraphs.
I want this to appear in the middle, I can do this using in html but I want it to be “in” on the sides, so it only fills the middle of the screen, away from the edges on the sides.
How to do this?
EDIT:
DESCRIPTION OF PAGE:
EMPTY SPACE |<——text here——>| EMPTY SPACE
There are various different ways of centering text in a page. For now I will assume you mean horizontal centering.
You haven’t provided any code for anyone to work with, so I will assume the code goes as follows:
To center the paragraph text in the middle of the page, you need to add the following CSS (in a
styleelement or an external.cssfile): first exampleThis is probably not what you’re after because it wont push the text away from the edges. If you would like the text to have a fluid width with some padding, use this CSS instead: second example
You can of course center the text using both methods to make the text centered and stay away from the edges.
If you would like a static width that stays centered, use this CSS instead of the padding: third example