vertical-alignment

Vertical Text Direction

不想你离开。 提交于 2019-11-26 02:50:26
问题 I have been trying text to go in a vertical direction like we can do in ms-word tables but so far I have only been able to do THIS... which I am not happy with because it\'s a box rotated... Isn\'t there a way to have actual vertical direction text? I only set the rotation to 305 degrees in the demo which doesn\'t make the text vertical. 270deg will but I only made the demo to show rotation. 回答1: Alternative approach: http://www.thecssninja.com/css/real-text-rotation-with-css p { writing-mode

Add centered text to the middle of a <hr/>-like line

别说谁变了你拦得住时间么 提交于 2019-11-26 02:26:53
问题 I\'m wondering what options one has in xhtml 1.0 strict to create a line on both sides of text like-so: Section one ----------------------- Next section ----------------------- Section two I\'ve thought of doing some fancy things like this: <div style=\"float:left; width: 44%;\"><hr/></div> <div style=\"float:right; width: 44%;\"><hr/></div> Next section Or alternatively, because the above has problems with alignment (both vertical and horizontal): <table><tr> <td style=\"width:47%\"><hr/><

How to set the margin or padding as percentage of height of parent container?

喜你入骨 提交于 2019-11-26 02:17:09
问题 I had been racking my brains over creating a vertical alignment in css using the following .base{ background-color:green; width:200px; height:200px; overflow:auto; position:relative; } .vert-align{ padding-top:50%; height:50%; } <!-- and used the following div structure. --> <div class=\"base\"> <div class=\"vert-align\"> Content Here </div> </div> While this seemed to work for this case, i was surprised that when i increased or decreased the width of my base div, the vertical alignment would

UIButton custom font vertical alignment

风格不统一 提交于 2019-11-26 02:04:10
问题 I\'ve got a UIButton which uses a custom font, which is set when my view loads: - (void)viewDidLoad { [super viewDidLoad]; self.searchButton.titleLabel.font = [UIFont fontWithName: @\"FONTNAME\" size: 15.0 ]; } The problem I\'ve got is that the font is appearing to float up of the center line. If I comment out this line, the default font appears vertically centered fine. But changing to the custom font breaks the vertical alignment. I\'m getting the same issue on a Table Cell with a custom

vertical align middle in <div>

依然范特西╮ 提交于 2019-11-26 01:49:11
问题 I want to keep the height of #abc div at 50px and text to align vertically in the middle of the div . body{ padding: 0; margin: 0; margin: 0px auto; } #main{ position: relative; background-color:blue; width:500px; height:500px; } #abc{ font:Verdana, Geneva, sans-serif; font-size:18px; text-align:left; background-color:#0F0; height:50px; vertical-align:middle; } <div id=\"main\"> <div id=\"abc\"> asdfasdfafasdfasdf </div> </div> 回答1: You can use line-height: 50px; , you won't need vertical

Vertical (rotated) label in Android

人盡茶涼 提交于 2019-11-26 01:25:09
问题 I need 2 ways of showing vertical label in Android: Horizontal label turned 90 degrees counterclockwise (letters on the side) Horizontal label with letters one under the other (like a store sign) Do I need to develop custom widgets for both cases (one case), can I make TextView to render that way, and what would be a good way to do something like that if I need to go completely custom? 回答1: Here is my elegant and simple vertical text implementation, extending TextView. This means that all

Vertically align text next to an image?

北城以北 提交于 2019-11-26 01:18:19
问题 Why won\'t vertical-align: middle work? And yet, vertical-align: top does work. span{ vertical-align: middle; } <div> <img src=\"http://lorempixel.com/30/30/\" alt=\"small img\" /> <span>Doesn\'t work.</span> </div> 回答1: Actually, in this case it's quite simple: apply the vertical align to the image. Since it's all in one line, it's really the image you want aligned, not the text. <!-- moved "vertical-align:middle" style from span to img --> <div> <img style="vertical-align:middle" src="https

div vertical align middle css

☆樱花仙子☆ 提交于 2019-11-26 01:02:30
I'm trying to get my text to vertically align to the middle of the div of the abc div only. I want to keep the height at 50px and text to align vertically in the middle of the div. I've yet to find a solution to this problem, maybe I'm not searching the right things. body{ padding: 0; margin: 0; margin: 0px auto; } #main{ position: relative; background-color:blue; width:500px; height:500px; } #abc{ font:Verdana, Geneva, sans-serif; font-size:18px; text-align:left; background-color:#0F0; height:50px; vertical-align:middle; } <div id="main"> <div id="abc"> asdfasdfafasdfasdf </div> </div> You

Vertically align text within a div [duplicate]

馋奶兔 提交于 2019-11-26 00:56:38
问题 This question already has an answer here: How do I vertically align text in a div? 30 answers The code below (also available as a demo on JS Fiddle) does not position the text in the middle, as I ideally would like it to. I cannot find any way to vertically centre text in a div , even using the margin-top attribute. How can I do this? <div id=\"column-content\"> <img src=\"http://i.stack.imgur.com/12qzO.png\"> <strong>1234</strong> yet another text content that should be centered vertically <

How to vertically center content with variable height within a div?

痞子三分冷 提交于 2019-11-26 00:50:18
问题 What is the best way to vertically center the content of a div when the height of the content is variable. In my particular case, the height of the container div is fixed, but it would be great if there were a solution that would work in cases where the container has a variable height as well. Also, I would love a solution with no, or very little use of CSS hacks and/or non-semantic markup. 回答1: Just add position: relative; top: 50%; transform: translateY(-50%); to the inner div. What it does