How to verticllay align text in a div-box?

Discussion in 'HTML' started by metalive, Jul 17, 2005.

  1. metalive

    metalive Guest

    Hello!

    I want to create a footer as a narrow line at the bottom of the screen
    and am therefore using a div-box formatted with "height:25px;".

    The line of text in it though, is aligned at the top the the footerbox,
    and I've tried to get it vertically middled using
    "vertical-align:middle;" on the the div-box, which didn't work. The next
    thing I tried was to wrap the line of text into a <span> and then
    applied the "vertical-align:middle;" on that, but neither did that work.

    Can someone tell me the solution please?
    THX
    Nick
     
    metalive, Jul 17, 2005
    #1
    1. Advertising

  2. metalive

    Spartanicus Guest

    metalive <> wrote:

    >I want to create a footer as a narrow line at the bottom of the screen
    >and am therefore using a div-box formatted with "height:25px;".
    >
    >The line of text in it though, is aligned at the top the the footerbox,
    >and I've tried to get it vertically middled using
    >"vertical-align:middle;" on the the div-box, which didn't work. The next
    >thing I tried was to wrap the line of text into a <span> and then
    >applied the "vertical-align:middle;" on that, but neither did that work.
    >
    >Can someone tell me the solution please?


    Specify a top and bottom padding on the footer box.

    --
    Spartanicus
     
    Spartanicus, Jul 17, 2005
    #2
    1. Advertising

  3. metalive

    Neredbojias Guest

    With neither quill nor qualm, metalive quothed

    > Hello!
    >
    > I want to create a footer as a narrow line at the bottom of the screen
    > and am therefore using a div-box formatted with "height:25px;".
    >
    > The line of text in it though, is aligned at the top the the footerbox,
    > and I've tried to get it vertically middled using
    > "vertical-align:middle;" on the the div-box, which didn't work. The next
    > thing I tried was to wrap the line of text into a <span> and then
    > applied the "vertical-align:middle;" on that, but neither did that work.


    Vertical-align must have some other text to relate to. For what you
    want, my advice is to use a table.

    --
    Neredbojias
    Contrary to popular belief, it is believable.
     
    Neredbojias, Jul 18, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kay
    Replies:
    2
    Views:
    7,228
  2. acko bogicevic

    Align text in text box

    acko bogicevic, Jan 9, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    60,879
    Michelle Stone
    Jan 9, 2004
  3. tshad

    text-align vs align

    tshad, Jun 23, 2005, in forum: HTML
    Replies:
    1
    Views:
    1,323
    David Dorward
    Jun 23, 2005
  4. Gnarlodious
    Replies:
    4
    Views:
    17,704
    elizas
    May 5, 2010
  5. Steve Richter
    Replies:
    1
    Views:
    938
    Mark Rae
    Jun 24, 2007
Loading...

Share This Page