Questions tagged [vertical-alignment]

Typically a style or other UI definition associated with the placement of an interface item in the vertical plane.

3252 questions
107
votes
7 answers

CSS: How to align vertically a "label" and "input" inside a "div"?

Consider the following code: HTML:
CSS: div { height: 50px; border: 1px solid blue; } What would be the easiest method to put the label and the input in…
Misha Moroshko
  • 166,356
  • 226
  • 505
  • 746
104
votes
8 answers

How to vertically align 2 different sizes of text?

I know to vertically align text to the middle of a block, you set the line-height to the same height of the block. However, if I have a sentence with a word in the middle, that is 2em. If the entire sentence has a line-height the same as the…
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
94
votes
9 answers

How can I align text in columns using Console.WriteLine?

I have a sort of column display, but the end two column's seem to not be aligning correctly. This is the code I have at the moment: Console.WriteLine("Customer name " + "sales " + "fee to be paid " + "70% value "…
Stephen Smith
  • 953
  • 1
  • 7
  • 6
93
votes
3 answers

Why doesn't vertical-align work properly when using float in CSS?

How can I use the vertical-align as well as float in the div properties? The vertical-align works fine if I do not use the float. But if I use the float, then it does not work. It is important for me to use the float:right for the last div. I am…
user1355300
  • 4,867
  • 18
  • 47
  • 71
91
votes
10 answers

Why is vertical-align:text-top; not working in CSS

I want to align some text to the top of a div. It seems that vertical-align: text-top; should do the trick, but it doesn't work. The other things that I have done, such as putting the divs into columns and displaying a dashed border (so I can see…
Ankur
  • 50,282
  • 110
  • 242
  • 312
90
votes
12 answers

Text vertical align in react native (using nativebase)

I was wondering there is a way I can align vertically in React Native. I'm trying to position on the bottom but I don't think I can find a good way to do it. If anyone knows how to solve this issue, please let me know.
ckim16
  • 1,569
  • 3
  • 19
  • 30
89
votes
7 answers

Vertically center rotated text with CSS

I have the following HTML:
Centered?
div.outer is a narrow vertical strip. div.inner is rotated 90 degrees. I would like the text "Centered?" to appear centered in its container div. I…
danvk
  • 15,863
  • 5
  • 72
  • 116
83
votes
2 answers

Align text to the bottom of a div

I tried to align my text to the bottom of a div from other posts and answers in Stack Overflow I learned to handle this with different CSS properties. But I can't get it done. Basically my HTML code is like this:
parascus
  • 1,079
  • 1
  • 10
  • 14
77
votes
7 answers

How to display list items as columns?

I'm trying to build my first responsive layout. I want to display list items in a vertical line, depending on width.
  • 1
  • 2
  • 3
  • 4
  • 5
Grozav Alex Ioan
  • 1,559
  • 3
  • 18
  • 26
75
votes
11 answers

Font Rendering / Line-Height Issue on Mac/PC (outside of element)

The Design The info widgets content should be vertically aligned in the middle as such: The Coded Design Windows: Chrome 20 / FF 14 / IE 9 Mac (Lion / Mt. Lion): Chrome / FF The Code HTML
rebz
  • 2,053
  • 3
  • 16
  • 16
74
votes
16 answers

I want to vertical-align text in select box

I want to vertically align the text in select box. I tried using select{ verticle-align:middle; } however it does not work in any browsers. Chrome seems to align the text in select box to the center as a default. FF aligns it to the top and IE…
user_1357
  • 7,766
  • 13
  • 63
  • 106
74
votes
8 answers

Align vertically using CSS 3

With CSS 3, are there any way to vertically align an block element? Do you have an example? Thank you.
tho
  • 741
  • 1
  • 6
  • 3
70
votes
7 answers

Why is width: 100% not working on div {display: table-cell}?

I'm trying to vertically and horizontally center some content overlaying an image slide (flexslider). There were some similar questions to this one, but I couldn't find a satisfactory solution that applied directly to my specific problem. Because…
timshutes
  • 2,259
  • 3
  • 22
  • 28
63
votes
9 answers

DataGrid row content vertical alignment

I have a regular DataGrid from WPF 4.0 RTM, where I put data from a database. In order to make clean & light style of DataGrid I use a tall/high rows and by default DataGrid aligns row content in top vertical position, but I want to set a center…
Mike
  • 14,010
  • 29
  • 101
  • 161
63
votes
3 answers

vertical-align image in div

i have problem with image vertical-align in div .img_thumb { float: left; height: 120px; margin-bottom: 5px; margin-left: 9px; position: relative; width: 147px; background-color: rgba(0, 0, 0, 0.5); border-radius:…
aainaarz
  • 782
  • 1
  • 7
  • 14