SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    aligning text horizontally in a div

    Hi there.

    As the title, how do you do it?

    i would like the text to be central from top to bottom.

    I dont mean from left to right by using left and right autos.

    Thanks.John.

  2. #2
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    If it's one line of text, you could give the container div:

    Code:
    #name {
    height: 50px;
    line-height: 50px;
    }

  3. #3
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    many thanks

  4. #4
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Horizontally = left/right
    Vertically = top/bottom

    This was asked just a few days ago: Vertically centre text within a div That thread explains how to vertically align more than just one line of text.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.


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
  •