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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to make text appear centered?

    hello!
    this is my first question here and it's a very nooby one

    [code]
    div#left{
    background-color:#E8E8E8;
    float: left;
    width:250px;
    height:450px;
    }

    div#text{

    text-align:center;
    font-family:verdana;

    }
    [code]

    the part of the text that is in the same width with the div#left appears a little to right than the rest of the text that follows.
    thank you

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,459
    Thanks
    0
    Thanked 632 Times in 622 Posts
    Text is always centred within ita container. If different centred text don't line up then it means that the containers don't line up. You will need to check the sidth and alignment of the containers to work out what the difference is.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thank you

    -------


  •  

    Posting Permissions

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