Previous Message
Next Message

Vertical alignment of text within div

Sent by Dominik Rabiej on 21 June 2004 23:11


Hi all,

I'm new to the list and recently struggled with the same issue of
centering an image within a floating div.  I found what I was looking
for here:
http://mrclay.org/web_design/centered_image/

Essentially you need to pad the image with non-breaking spaces so as
to tell CSS that you are playing with text; then vertical-align:
middle will work because it is operating on an image inside text,
instead of a pure image.

-dominik

On Mon, 21 Jun 2004 21:32:20 +0200, Roger Johansson
[EMAIL-REMOVED]> wrote:
> 
> 
> On 21 jun 2004, at 20.53, Jon Jensen wrote:
> >
> > If you want to align text at the bottom of a div, the best way is to
> > make
> > the div "position:relative;", and then put the text in a container (p
> > or div
> > or whatever) inside the aforementioned div and make it
> > "position:absolute;
> > bottom:0;"
> 
> You could also use display:table-cell and vertical-align:middle to make
> all browsers that support it (all except IE) to make them vertically
> align the text, and let IE display the text normally (top aligned) I've
> experimented a bit with this:
> <
> http://www.456bereastreet.com/archive/200406/
> equal_height_boxes_with_css_part_ii/ >
> 
> /Roger
> 
> --
> http://www.456bereastreet.com/
> 
> 
> 
> ______________________________________________________________________
> css-discuss [EMAIL-REMOVED]]
> http://www.css-discuss.org/mailman/listinfo/css-d
> List wiki/FAQ -- http://css-discuss.incutio.com/
> Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
>
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: