SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Mar 2006
    Posts
    701
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Setting text at the midle of the div

    I have a div and I want if the text is sort (below 100 characters for example) to set it at the centre of this div.
    How can I do that?

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    What do you mean by "centre"? Vertically? Horizontally? Both? It's hard to help you without some sample HTML.

  3. #3
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,696
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by Raffles View Post
    What do you mean by "centre"? Vertically? Horizontally? Both? It's hard to help you without some sample HTML.
    I think he wants the text to be horizontally centered, but only if the text is short enough to fit on one line, that 100 characters he was mentioning.
    It should only mean scripting the setting of a class name to the appropriate element.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

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