Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > div and vertical align

Reply
Thread Tools

div and vertical align

 
 
Tobias Müller
Guest
Posts: n/a
 
      11-25-2003
Hi,

doesn't "div" supports vertical align?

<div class="text">Hello World</div>

and

..text {
height: 100px;
vertical-align: bottom;
}

doens't work. Any hints?

Regards from Germany
Tobias


 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      11-25-2003
"Tobias Müller" <(E-Mail Removed)> wrote:

> doesn't "div" supports vertical align?


The vertical-align property (which is CSS, not HTML) applies to inline
elements and table cell elements only. By default, a div element is a block
element.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


 
Reply With Quote
 
 
 
 
Steve Pugh
Guest
Posts: n/a
 
      11-25-2003
"Tobias Müller" <(E-Mail Removed)> wrote:

>doesn't "div" supports vertical align?


No. Nor does any other block level element. Look it up in the CSS spec
- http://www.w3.org/TR/CSS2/visudet.ht...vertical-align

"Applies to: inline-level and 'table-cell' elements"

><div class="text">Hello World</div>
>
>
>.text {
> height: 100px;
> vertical-align: bottom;
>}
>
>doens't work. Any hints?


Use padding and/or line-height. Or if IE is not required to support
this part of the presentation use display: table-cell along with
vertical-align.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
<div align=center> also affects align of dynamic dropdown item text Steve Richter ASP .Net 1 06-24-2007 07:11 PM
[CSS] Div-Tag and Vertical Align =?UTF-8?B?TWFydGluIFDDtnBwaW5n?= HTML 6 08-22-2006 04:09 AM
Vertical align image within a DIV in IE? Paul Lautman HTML 6 04-03-2006 05:42 PM
vertical-align and div Jochen Fuhrmann HTML 1 10-06-2003 10:35 AM
how to Align text left & vertical align middle Kay ASP .Net 2 07-25-2003 08:32 AM



Advertisments