Typically a style or other UI definition associated with the placement of an interface item in the vertical plane.
Questions tagged [vertical-alignment]
3252 questions
60
votes
0 answers
How to vertical align image inside div
Possible Duplicate:
How to properly vertically align an image
Image size changes but the div size is fixed
These are CSS but not working. Is it possible to achieve this without using background feature of CSS.
This is CSS class which image is…

Furkan Gözükara
- 22,964
- 77
- 205
- 342
55
votes
11 answers
Vertical align all(!) elements in TD?
I have a simple table with 1 TD with vertical-align:middle;. This TD contains an Image :
table
{
border:solid 1px red;
width:300px;
}
td
{
height:100px;
vertical-align:middle;
width:100%;
border:solid 1px green;
}
img
{
…

Royi Namir
- 144,742
- 138
- 468
- 792
54
votes
7 answers
Vertically aligning a checkbox
I have looked at the different questions regarding this issue, but couldn't find anything that works due to limitations in my markup.
My markup looks like so (unfortunately as this is generated by some backend, I am unable to change the…

F21
- 32,163
- 26
- 99
- 170
53
votes
7 answers
Is there a "right" way to have NSTextFieldCell draw vertically centered text?
I have an NSTableView with several text columns. By default, the dataCell for these columns is an instance of Apple's NSTextFieldCell class, which does all kinds of wonderful things, but it draws text aligned with the top of the cell, and I want the…

e.James
- 116,942
- 41
- 177
- 214
51
votes
2 answers
CSS metaphysics: WHY is page vertical alignment so difficult?
Relative to the page, horizontal alignment in CSS is easy - a margin:0 auto gets you by much of the time, and a text-align:center for some other cases.
My question to the gurus is not how to vertically align, but why is it so much more difficult? …

Ben
- 54,723
- 49
- 178
- 224
50
votes
2 answers
How to vertically align floating divs to the bottom?
Because examples rule: http://jsfiddle.net/rudiedirkx/wgue7/
How do I get the bars to the bottom instead of the top? Now they're sticking to the top of the container (#bars) but I want them sticking to the bottom.
As you can see, I don't know the…

Rudie
- 52,220
- 42
- 131
- 173
49
votes
7 answers
HTML-CSS Center Text horizontally and vertically in a link
I am trying to make a link which has a height and a width of 200px.
The text of the link shall be centered vertically and horizontally.
This is my CSS so far:
a:link.Kachel {
width: 200px;
height: 200px;
margin: 0 auto;
display: block;
…

user1567896
- 2,398
- 2
- 26
- 43
47
votes
3 answers
How to vertically middle-align floating elements of unknown heights?
I have a (horizontally) centered outer div containing two elements of unknown width:
Both floats are top-aligned by default,…
...
...

Yang
- 16,037
- 15
- 100
- 142
46
votes
7 answers
Center an tag inside a
I have the following inside a tag:
Yes
And these are their CSS classes:
#AlertDiv {
position:absolute;
height: 51px;
left: 365px;
top: 198px;
width: 62px;
…
VansFannel
- 45,055
- 107
- 359
- 626
I have the following
inside a tag:
And these are their CSS classes:
#AlertDiv {
position:absolute;
height: 51px;
left: 365px;
top: 198px;
width: 62px;
…
Yes

VansFannel
- 45,055
- 107
- 359
- 626
44
votes
9 answers
CSS: Vertically align div when no fixed size of the div is known
How do I align a
which contains an image (or flash) vertically with CSS. Height and width are dynamic.

Oleg Tarasenko
- 9,324
- 18
- 73
- 102
44
votes
1 answer
UITextField Vertical Alignment
Is there a way to vertically align text in a UITextField half-way between UIControlContentVerticalAlignmentCenter and UIControlContentVerticalAlignmentBottom or do I have to go with one of those?

Matt Winters
- 1,099
- 2
- 12
- 22
44
votes
3 answers
How to vertically center the contents of a flexbox item
I'm trying to center the CONTENTS of a flexbox item while using justify-content:stretch; It appears that the old trick of using display:table-cell;vertical-align:middle; doesn't work in this situation. What does?
.flex-container {
display:flex;
…

emersonthis
- 32,822
- 59
- 210
- 375
44
votes
5 answers
Align top of image to top of TextView
I want to create a layout that aligns the top of an image to the top of a TextView like this:
--------- Text text text text text text text
| Image | text text text text text text text
--------- text text text text text text text
text…

Claes
- 723
- 1
- 6
- 10
43
votes
5 answers
jQuery - Scroll element to the middle of the screen instead of to the top with an anchor link
I'm building a one-page site with a fixed-positioned navigation bar which scrolls smoothly to the different section elements through anchor links. The default behaviour for scrolling to an element is to align it to the top of the browser window.…

Nils Kaspersson
- 8,816
- 3
- 29
- 30
42
votes
3 answers
What's the deal with vertical-align: baseline?
I thought I knew my way around CSS, but I needed to explain something to someone just now and I found I couldn't.
My question basically boils down to: why is vertical-align:baseline ignored when there are other alignments in the same line?
Example:…

Mr Lister
- 45,515
- 15
- 108
- 150