Vertically and Horizontally Center (Text)

Discussion in 'CSS' started by inventivenerd, Nov 19, 2008.

  1. #1
    Dear Friends,

    I am pretty much new in CSS platform. Can anybody please help me regarding putting text vertically and horizontally center in a row ? by using DIV

    Waiting for replies.

    Regards
    John
     
    inventivenerd, Nov 19, 2008 IP
  2. wanttoknow

    wanttoknow Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I am not an expert, but, why not use <table> to put text in the position you want?
     
    wanttoknow, Nov 19, 2008 IP
  3. mahendra rajeshirke

    mahendra rajeshirke Active Member

    Messages:
    402
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #3
    u have to give style tag to ur div ,like <div style=""> and when u give space after word in div tag u wil see a list that consists of lots of tags, select style tag,so after adding style tag press enter after this give space and u wil find other sub elements in style tag, press v to select vertical-align, press ; and give spave and press t to select text-align and complete with ;

    look like this<div style="vertical-align:middle; text-align:center;padding-top:125px; height:125px"></div>

    give padding to get centered text frm top, but u have to decrease height according to padding. in above tag ur exact height is 250px;
     
    mahendra rajeshirke, Nov 19, 2008 IP
  4. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #4
    kk5st, Nov 19, 2008 IP
    mahendra rajeshirke likes this.
  5. mahendra rajeshirke

    mahendra rajeshirke Active Member

    Messages:
    402
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #5
    ok kk5st u r right, i also learned from it, since i got it i used my old style, thnx
     
    mahendra rajeshirke, Nov 20, 2008 IP