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?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #240115
    drone4four
    Participant

    Here is my test case: http://codepen.io/Angeles4four/pen/dMVZxd

    Notice the copyright is over to the left? I’m trying to position it at the center. In my CSS I include the position property (center) which is why I can’t figure out why it is still sitting way over at the left.

    Thanks for your attention.

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

    #240143
    drone4four
    Participant

    Thank-you @Atelierbram for sharing Coyier’s guide. And thanks for the advice on using paragraph tags instead of line breaks.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.