Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How do I position text to the center of the page? Reply To: How do I position text to the center of the page?

#240116
Atelierbram
Participant

In my CSS I include the position property (center)

When you read up on the CSS position -property you will see that there are five possible values: static, relative, absolute, fixed and inherit .

You can center a block-level element with the margin-right and margin-left values set to auto.

Fork of your demo Maybe not directly related to this, but another thing to keep in mind is trying to use HTML markup that is “as semantic as possible”, so always try to use valid HTML-elements, like p-tags for paragraphs, for example. When consistently applied you will find a lot of the time you don’t need things like br-tags to force line-breaks.