Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Dec 2011
    Posts
    40
    Thanks
    14
    Thanked 0 Times in 0 Posts

    How to CENTER text but with left margin of 60px and without TABLEs?

    Assume I want to place some text centered on a web page.
    BUT: the center place should be calculated with the left margin of 60px.

    That means the left border of space should be = left border of browser window + 60px


    How can I achieve this?

    Peter

  • #2
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,950
    Thanks
    9
    Thanked 724 Times in 718 Posts
    If it's just text, then the following css would achieve what you want:

    Code:
    .mystyle{margin-left:60px;text-align:center}
    with (for example}

    Code:
    <p class="mystyle">Centered and offset on the left</p>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •