![]() |
|
|
|
#1 |
|
How can I make something in a DIV vertically centered without using tables,
the CSS equivalent (if there is one) of <td valign="middle">? ie: -------------------------------------------- xxxxx xxxxx xxxxx This text is vertically centered xxxxx xxxxx -------------------------------------------- Where x represents space used by an image Nik Coughin |
|
|
|
|
#2 |
|
Posts: n/a
|
in post: <news:bNjPb.18673$>
"Nik Coughin" <nrkn!no-spam!@woosh.co.nz> said: > -------------------------------------------- > xxxxx > xxxxx > xxxxx This text is vertically centered > xxxxx > xxxxx > -------------------------------------------- > > Where x represents space used by an image theres a few different ways to do it. heres one: http://moreshit.bruciesusenetshit.in...gn-thingy.html heres another one: http://www.w3.org/Style/Examples/007....html#vertical or you can use margins/padding -- brucie - i usenet nude |
|
|
|
#3 |
|
Posts: n/a
|
I like your way better. I already considered resorting to a table cell as
suggested by W3 (!), but didn't like the idea. Scoured Google for this for a while, didn't find anything as elegant as that, got sick of wading through the irrelevant bullshit. Thanks a heap. "brucie" <****@bruciesusenetshit.info> wrote in message news:bukjuo$ivc9i$... > in post: <news:bNjPb.18673$> > "Nik Coughin" <nrkn!no-spam!@woosh.co.nz> said: > > > -------------------------------------------- > > xxxxx > > xxxxx > > xxxxx This text is vertically centered > > xxxxx > > xxxxx > > -------------------------------------------- > > > > Where x represents space used by an image > > theres a few different ways to do it. heres one: > http://moreshit.bruciesusenetshit.in...gn-thingy.html > > heres another one: > http://www.w3.org/Style/Examples/007....html#vertical > > or you can use margins/padding > > -- > brucie - i usenet nude |
|
|
|
#4 |
|
Posts: n/a
|
Oops, top-posted. Sorry.
|
|
|
|
#5 |
|
Posts: n/a
|
On Wed, 21 Jan 2004 14:36:37 +1300, "Nik Coughin"
<nrkn!no-spam!@woosh.co.nz> declared in alt.html: > Oops, top-posted. Sorry. http://home.in.tum.de/~jain/software/oe-quotefix/ -- Mark Parnell http://www.clarkecomputers.com.au |
|
|
|
#6 |
|
Posts: n/a
|
Mark Parnell wrote:
> On Wed, 21 Jan 2004 14:36:37 +1300, "Nik Coughin" > <nrkn!no-spam!@woosh.co.nz> declared in alt.html: > >> Oops, top-posted. Sorry. > > http://home.in.tum.de/~jain/software/oe-quotefix/ Thanks |
|
|
|
#7 |
|
Posts: n/a
|
in post: <news:yHkPb.18729$>
"Nik Coughin" <nrkn!no-spam!@woosh.co.nz> said: > I already considered resorting to a table cell as > suggested by W3 (!), but didn't like the idea. using the visual appearance of at table cell (css table model) is not the same as using a html table. -- brucie - i usenet nude |
|
|
|
#8 |
|
Posts: n/a
|
In article brucie wrote:
> in post: <news:bNjPb.18673$> > "Nik Coughin" <nrkn!no-spam!@woosh.co.nz> said: [vertical-centering] > theres a few different ways to do it. heres one: > http://moreshit.bruciesusenetshit.in...gn-thingy.html > > heres another one: > http://www.w3.org/Style/Examples/007....html#vertical > > or you can use margins/padding Some more methods here: http://www.student.oulu.fi/~laurirai/www/css/middle/ -- Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts> Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään. |
|
|
|
#9 |
|
Posts: n/a
|
On Wed, 21 Jan 2004 11:17:38 +1000, brucie <****@bruciesusenetshit.info>
wrote: >theres a few different ways to do it. heres one: >http://moreshit.bruciesusenetshit.in...gn-thingy.html Could you please repost this page? I'm getting a 404 **** Not Found error. (I've been out of the country and just got back, which is why I didn't see it when you first posted it.) > >heres another one: >http://www.w3.org/Style/Examples/007....html#vertical > >or you can use margins/padding > >-- >brucie - i usenet nude |
|
|
|
#10 |
|
Posts: n/a
|
wrote:
> On Wed, 21 Jan 2004 11:17:38 +1000, brucie > <****@bruciesusenetshit.info> wrote: >> theres a few different ways to do it. heres one: >> http://moreshit.bruciesusenetshit.in...gn-thingy.html > > Could you please repost this page? I'm getting a 404 **** Not Found > error. (I've been out of the country and just got back, which is why > I didn't see it when you first posted it.) > > >> >> heres another one: >> http://www.w3.org/Style/Examples/007....html#vertical >> >> or you can use margins/padding >> >> -- >> brucie - i usenet nude One of the ways that it was done on that page (I made the original request) was something like this: ..verticalcenter { vertical-align: middle; } .... <div> <img src="Spacer.png" alt="" height="51" width="0" class="verticalcenter" />Some text </div> The text then appears vertically centered in that div. I think that the height of the image is important, I seem to vaguely recall someone saying that it had to be taller than the text (makes sense if you want to have something to vertically center it against). There was another method but the above one worked well for me. |
|