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 4 of 4
  1. #1
    New Coder
    Join Date
    Apr 2007
    Posts
    85
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Set a number in the middle of the box?

    Sorry, I only know of the text-align:center property which is not working, I have a number 40 that I want right in the middle, equal padding on all sides, how can I do this? Thank you.
    I am on my way. :)

  • #2
    Regular Coder Jutlander's Avatar
    Join Date
    Jun 2007
    Location
    In my own sick little world :P
    Posts
    425
    Thanks
    1
    Thanked 12 Times in 12 Posts
    Some code would be nice to see.

    I presume that it is an image with the number 40?

    Code:
    img.center {
    display: block;
    margin: 0 auto;
    }
    Code:
    <img class="center" src="path.ext">
    .
    .

  • #3
    New Coder
    Join Date
    Apr 2007
    Posts
    85
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Jutlander View Post
    Some code would be nice to see.

    I presume that it is an image with the number 40?

    Code:
    img.center {
    display: block;
    margin: 0 auto;
    }
    Code:
    <img class="center" src="path.ext">


    Eh, it's not an image. Nevertheless I will try is. It's an number loaded via ajax.
    I am on my way. :)

  • #4
    Regular Coder Jutlander's Avatar
    Join Date
    Jun 2007
    Location
    In my own sick little world :P
    Posts
    425
    Thanks
    1
    Thanked 12 Times in 12 Posts
    If it's a number then I don't see why text-align: center; shouldn't work.
    .
    .


  •  

    Posting Permissions

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