> -----Original Message----- > From: css-d-boun...@lists.css-discuss.org [mailto:css-d- > boun...@lists.css-discuss.org] On Behalf Of Tim Dawson > Sent: 13 April 2009 09:46 > To: css-d@lists.css-discuss.org > Subject: [css-d] Vertically centering text in a paragraph > > I'm working on a site which has several images on the page (300x225px). > Each > image has some descriptive text alongside, which generally is not as > high as the > image. My client would like the text vertically centred on the image. > > http://www.mull-bed-and-breakfast.co.uk/newcrofts/self-catering.php > > CSS deliberately seems to avoid a v-align capability in paragraphs. I > realise I > could introduce padding, but that would have to be tailored for every > piece of > text. Tables allow v-align in cells, I know, but I don't want to go > that route > either Is there a better way, please ? >
Hi Tim This has been in discussion a few times. Here is the link that will help you. http://www.mondiara.com/graphics/valign.html It is based on display:table and display:table-cell where your div acts like a table. Follow the CSS in the example and you will find all you need. Cheers Ian Iyesolutions.co.uk ______________________________________________________________________ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/