vertical-alignment

Vertically align text within div element

戏子无情 提交于 2019-12-01 02:57:25
I know this question has been asked to death but nothing through searching has worked for me. You know the deal, I have a div element that I need to vertically align text in but nothing has worked (position:absolute;top:50%;margin-top:-x;display:table-cell;vertical-align:middle;etc., etc.) Here is what I am working with (sorry for the inline CSS). Anyway, the I would use line-height but the text can be one or two lines. It should vertical align with the image which is always max-height of 30px (30x50). <div style="margin:0 0 10px 0;padding:10px;border:2px solid #606060;background-color:#2b2b2b

How to align Facebook and Tweet buttons?

ぃ、小莉子 提交于 2019-12-01 02:29:18
The Facebook and Tweet buttons on our home page are vertically misaligned, and we're confused why. We can top align the two buttons if we use Firebug and remove the height for the Tweet button. However, the height is set dynamically, and inlined, from a Twitter script. We can't seem to override the height value. Here's the home page: http://www.panabee.com Are we doing something wrong in the CSS? Or is there a parameter we need to set in the Tweet button to override the height value? Our only other option is to resort to the Twitter iFrame for the Tweet button, which we prefer not to do.

Vertically align text within div element

耗尽温柔 提交于 2019-11-30 22:35:40
问题 I know this question has been asked to death but nothing through searching has worked for me. You know the deal, I have a div element that I need to vertically align text in but nothing has worked (position:absolute;top:50%;margin-top:-x;display:table-cell;vertical-align:middle;etc., etc.) Here is what I am working with (sorry for the inline CSS). Anyway, the I would use line-height but the text can be one or two lines. It should vertical align with the image which is always max-height of

How can I vertically align a <table> in the middle of a fixed height <div>?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 20:17:56
Why does the code below not cause the <table> to be vertically-aligned in the middle of the <div> ? <div style="width: 850px; height: 470px;vertical-align: middle;" align="center"> <table style="padding-left: 20px; width: 700px; border: 10px groove #0033CC; background-color: #F9F9F9;"> <tr> <td>   </td> <td>   </td> <td>   </td> </tr> <tr> <td>   </td> <td>   </td> <td>   </td> </tr> <tr> <td>   </td> <td>   </td> <td>   </td> </tr> </table> </div> I want the <table> in the middle of the <div> , but it is at the top! How can I fix this? Thanks for your future advice. Outside of table cells,

Div height doesn't adjust to fit content

∥☆過路亽.° 提交于 2019-11-30 18:34:12
问题 How can I center a div horizontally and vertically and adjust height to fit content? fiddle Here is my html code: <div class="sprite"> </div> <div class="content"> <span>close</span> <div class="centered"> lorem lipsum..... </div> </div> And css: .sprite{ position: fixed; left: 0px; top: 0px; z-index: 20; width: 100%; height: 100%; background-color: gray; opacity: 0.6; } .content{ border:1px solid red; z-index:21; position: absolute; margin:auto; padding:10px; left: 0px; top: 0px; bottom:0px;

NSTextField Vertical alignment

五迷三道 提交于 2019-11-30 17:27:07
I am creating cocoa app in which i created NSTextField programmatically like this, NSView *superView = [[NSView alloc] initWithFrame:NSMakeRect(0, 300, 1400, 500)]; NSTextField *myTextField = [[NSTextField alloc] initWithFrame:NSMakeRect(180, 100, 1000, 300)]; [myTextField setStringValue:myText]; [myTextField setEditable:NO]; [myTextField setBezeled:NO]; [myTextField setDrawsBackground:NO]; [myTextField setSelectable:NO]; [myTextField setFont:[NSFont fontWithName:@"Futura" size:22]]; [superView addSubview:myTextField]; [superView setAutoresizesSubviews:YES]; [myTextField setAutoresizingMask

Vertical alignment of text in a table cell

青春壹個敷衍的年華 提交于 2019-11-30 17:11:58
I would like to align the text to bottom in the second cell. The first cell extends to 2 lines, because of insufficent width and that's OK But the text in the second cell is only one line and shows up at the top of the cell. How can I align it to bottom? I tried vertical-align="bottom" text-align="bottom" text-align="end" on row , cell and block levels.. Any of them worked?!? <fo:table font="normal 10 pt Arial, sans-serif" width="100%"> <fo:table-column column-width="40mm"/> <fo:table-column column-width="130mm"/> <fo:table-body> <fo:table-row> <fo:table-cell padding-before="3pt" padding-after

Vertically align text right of floated image, image sizes varied, responsive

邮差的信 提交于 2019-11-30 13:58:08
I'd like to vertically align multiple lines of text to the right of a left-floated image. However The image size (height and width) will vary and is unknown in advance The length of text varies also and will usually comprise multiple lines Solution needs to be responsive to adapt to varied screen sizes Solutions should not involve specific px width or height dimensions for images, divs or anything else I don't want to use tables as the text will need to drop underneath the image in certain scenarios when there isn't enough room for the text beside the image I've looked back through previous

how to vertically align text next to a floated image?

一世执手 提交于 2019-11-30 13:48:29
问题 I want to vertically align a span after a floated image. I searched for it in stack overflow and find this post. but my image is floated. <div> <img style="width:30px;height:30px; float:left"> <span style="vertical-align:middle">Doesn't work.</span> </div> I give vertical-align:middle to image and nothing change! Thanks 回答1: First remove float from it. Write like this: <img style="width:30px;height:30px;vertical-align:middle" src="http://lorempixel.com/output/abstract-q-c-640-480-8.jpg">

HTML-CSS Center Text horizontally and vertically in a link

只谈情不闲聊 提交于 2019-11-30 13:37:06
问题 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; text-align: center; background: #383838; display: -webkit-box; display: -moz-box; display: box; -webkit-box-align: center; -moz-box-align: center; box-align: center; } and this the HTML-code: <tr> <td> <a class="Kachel" href="#">Test</a> </td> </tr> The text is