vertical-alignment

textarea label vertical-align: middle

陌路散爱 提交于 2019-12-04 19:04:07
问题 I'm trying to align the label for this text area in the middle of the text box, but it just isn't working. The output looks something like this: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxx Synopsis: xxxxxxxxxxxxxxxxxxxxxxxxxxxx Here's the code I've been trying. TY! <style> label textarea{ vertical-align: middle; } </style> <label>Synopsis: <textarea style="border: none" rows="7" cols="60">$v_Synopsis</textarea></label> 回答1: CODEPEN DEMO HTML

WebKit vs Mozilla vertical alignment of font glyphs in box

半腔热情 提交于 2019-12-04 16:43:13
问题 This test image shows how wildly different Safari positions text inside a box vs Firefox (Safari 5.0.5 and Firefox 5.0.1 for Mac OS X 10.6.7). Notice how the "S" for sans-serif is butted up to the top of the box in Firefox and not Safari. The difference seem to vary depending on typeface used, where some are even consistently rendered. I've read people saying that this is because of rounding issues between font-size and line-height (and fixed by setting smaller height than size), but I think

vertical navigation with rotated text

大兔子大兔子 提交于 2019-12-04 13:46:28
问题 I am trying to achieve a vertical navigation menu which has links and I have rotated the links text to 270 degree with css3. I have rotated it because I wanted the text to be bottom to top. The problem is when I add a padding top it is getting inconsistent spacing. you can see my code here. I am unable to understand the different space being taken. I also tried giving li a height but it did not work. Please if someone could help me out. Here is my code: HTML : <div class="main-nav"> <ul class

vertically center div when body height: 100% without absolute pos

余生长醉 提交于 2019-12-04 13:42:14
问题 I have this to fill the window: html, body { height: 100%;} then a container also set to height: 100%, how do I vertically center a div with an image without specifying and set height in pixels and without using absolute positioning? Using padding-top: 50%; padding-bottom 50%; isn't working - seems to shift the div depending on device site or browser window. 回答1: You can use display:table and display:table-cell : html, body { width: 100%; height: 100%; } body{ margin: 0; display: table } body

different vertical alignment Font between ios6 and ios7

若如初见. 提交于 2019-12-04 12:33:24
I have some problem with the vertical alignment Font between iOS6 and iOS7, I have a custom font that in iOS6 was a bit higher then a centre of vertical alignment in a UIButton , so have I done it? I've set the myButton.titleEdgeInsets = UIEdgeInsetsMake(6, 0, 0, 0) and I've fixed the issue, but now with the iOS7 have the opposite issue now with iOS7 the font is a bit lower...How i can fix this problem for have the same result in both iOS? Thanks in advance 来源: https://stackoverflow.com/questions/19756284/different-vertical-alignment-font-between-ios6-and-ios7

CSS: Why is vertical-align: baseline stop working on Firefox when using overflow: hidden?

时光怂恿深爱的人放手 提交于 2019-12-04 10:25:56
问题 You can reproduce this by running this test case. The results are shown in the screenshot below. The issue is that on Firefox, when adding a overflow: hidden on the "block" (with grey background in the screenshot), the block stop being aligned as I'd like it to be: instead of the baseline of the text in the block being align to the the baseline of the parent box, it is as if the bottom of the block was aligned on the baseline of the parent box. As you can see in the screenshot, this doesn't

Wrong rendering of <sup> in table with valign=top in Chrome and Safari

旧时模样 提交于 2019-12-04 10:03:29
I have the following HTML: <p style="font-family:Verdana">test<sup>2</sup></p> <p style="font-family:Verdana;vertical-align:top">test<sup>2</sup></p> The problem is that in the second the <sup> is no longer positioned above the text but a few pixels lower. In essence the vertical-align:top raises all text except the superscripted to the top: This doesn't happen in Firefox, Opera but in Chrome and Safari (all Windows) and not with some fonts (like Times New Roman). Do you think this is a problem with the font or actually a bug in Webkit? There is already a bug reported and I attached my test

Bootstrap 3.0 - Vertically align 3 panels in the same row (Auto Height)

狂风中的少年 提交于 2019-12-04 09:15:29
问题 Trying to have a single row of 3 panels where the height expands according to the content and they all align properly. The left panel would have a graph in it, the two on the right would have tables that work with the graph on the left. Example of this working is this template: Click Here For Example <div class="row"> <div class="col-md-8"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Panel title</h3> </div> <div class="panel-body">Panel content </div>

How to vertically align image and text in table cell?

亡梦爱人 提交于 2019-12-04 09:12:18
I'm trying to get the text to be on the right side and vertically center aligned with the image. How can I do that? My current code: <div style="display: table;"> <div style="display: table-cell;"><img src="//dummyimage.com/100"></div> <div style="display: table-cell;">text</div> </div> use CSS3 Flexible Box Layout : from the documentation: providing for the arrangement of elements on a page such that the elements behave predictably when the page layout must accommodate different screen sizes and different display devices. For many applications, the flexible box model provides an improvement

iOS 5.0 Safari not vertically centering placeholder in text box

跟風遠走 提交于 2019-12-04 07:51:52
问题 I want to vertically center the text entered in input text boxes on the page. Typical way to achieve this is to set the line-height and height equal. This works on pre iOS 5.0 Safari. However; on iOS 5, Safari displays the typed text vertically centered... But the placeholder text and the cursor appear top aligned. .txtBox { line-height: 3em; height: 3em; } <input type="text" class="txtBox" placeholder="Name"></input> Anyone else facing this issue? 回答1: Setting line-height: 1; seems to fix