vertical-alignment

UTF-8 Width Display Issue of Chinese Characters

安稳与你 提交于 2019-12-23 12:14:29
问题 When I use Perl or C to printf some data, I tried their format to control the width of each column, like printf("%-30s", str); But when str contains Chinese character, then the column doesn't align as expected. see the attachment picture. My ubuntu's charset encoding is zh_CN.utf8, as far as I know, utf-8 encoding has 1~4 length of bytes. Chinese character has 3 bytes. In my test, I found printf's format control count a Chinese character as 3, but it actually displays as 2 ascii width. So the

UTF-8 Width Display Issue of Chinese Characters

风流意气都作罢 提交于 2019-12-23 12:13:27
问题 When I use Perl or C to printf some data, I tried their format to control the width of each column, like printf("%-30s", str); But when str contains Chinese character, then the column doesn't align as expected. see the attachment picture. My ubuntu's charset encoding is zh_CN.utf8, as far as I know, utf-8 encoding has 1~4 length of bytes. Chinese character has 3 bytes. In my test, I found printf's format control count a Chinese character as 3, but it actually displays as 2 ascii width. So the

CSS Vertical align text to the middle of image [duplicate]

淺唱寂寞╮ 提交于 2019-12-23 08:52:51
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How do I vertically align text next to an image with CSS? I have difficulties to center spans vertically middle in div. This simple code: http://jsfiddle.net/4hDTb/ HTML: <div class="bar"> <span>Simple text</span> <img src="" class="img1" /> <span>Another text</span> <img src="" class="img2" /> </div>​ CSS: .bar { width: 100%; height: 50px; border: 1px black solid; } .img1 { width: 100px; height: 50px; border:

CSS Vertical align text to the middle of image [duplicate]

喜夏-厌秋 提交于 2019-12-23 08:52:31
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How do I vertically align text next to an image with CSS? I have difficulties to center spans vertically middle in div. This simple code: http://jsfiddle.net/4hDTb/ HTML: <div class="bar"> <span>Simple text</span> <img src="" class="img1" /> <span>Another text</span> <img src="" class="img2" /> </div>​ CSS: .bar { width: 100%; height: 50px; border: 1px black solid; } .img1 { width: 100px; height: 50px; border:

Bootstrap form-horizontal vertical alignment of checkboxes without label text

点点圈 提交于 2019-12-23 07:57:32
问题 I have changed from Bootstrap 3.0.0 to 3.2.0 this morning because I needed some of the new features for my web application. Everything seemed to work as expected until I observed an issue with the vertical alignment of checkboxes in a .form-horizontal form. An example is available at http://www.bootply.com/AYN64feYze. The markup for this minimum example is: <div class="form-horizontal"> <div class="form-group"> <label class="col-sm-2 control-label">With label text</label> <div class="col-sm

ABSMIDDLE works differently on Firefox and Chrome?

若如初见. 提交于 2019-12-23 07:28:39
问题 I have an icon image and text like the following. The code source of everything is: <img src="...." align="absmiddle" /> My Title Here The problem is that the icon is not aligned vertically with the title in Chrome compared to firefox. I think the absmiddle doesn't work at all! Is there any solution? I don't want to use a table with 2 columns to fix this issue. 回答1: Try this solution: <img src="img.png" style="margin-bottom:.25em; vertical-align:middle;"> 回答2: vertical-align: middle; may be

how can I align to middle by height [duplicate]

穿精又带淫゛_ 提交于 2019-12-23 06:48:33
问题 This question already has answers here : Best way to center a <div> on a page vertically and horizontally? [duplicate] (30 answers) How do I vertically center text with CSS? [duplicate] (38 answers) Closed 4 years ago . I want to create image box(with image). It's ugly when text is in the top of box. How can I align text to middle? I tried to use vertical-align , but it seems, that it don't works Demo of my code EDIT: Your solution works fine with short messages. But if they will be multi

facebook photo/ image vertical align?

吃可爱长大的小学妹 提交于 2019-12-23 05:40:11
问题 How does facebook vertically align its photos? I inspected their img tag and its parent. The parent doesn't use padding and the img doesn't use margins. There is vertical-align, but I don't think it applies in this case(see Image not vertical-align:middle). I normally vertically align using margins (and sometimes with javascript) so I'm interested in how facebook does it without padding or margins. Does anyone know how they do it? 回答1: After doing some research in facebook's website i found

How do I vertically center an img in a div?

ぃ、小莉子 提交于 2019-12-23 04:28:08
问题 I have an <img> that I want to center in a <div> . All previous answers I've found here use some hack or require you to know the image's width, which varies in my case. Horizontal centering with text-align: center on the parent is easy. I can't figure out how to vertically align. jsFiddle example FYI Facebook does this well using just HTML and CSS. So please no <table> or javascript hacks. It looks like they are using something with line-height to make their <img> vertically center. 回答1:

Vertical Aligned Text and Image in list

不问归期 提交于 2019-12-23 02:45:29
问题 Is there a way of vertical aligning text and an image in a list? e.g. <li>Some text here <img src="image.jpg" alt="" /></li> The text doesn't align in the middle of the side of the image, it appears at the bottom then the image is next to it. I need the text to be in the center point between the image on the side. What's the best way of doing it? I know having a image inside a list isn't valid HTML (AFAIK). Thanks :) 回答1: You can use li img {vertical-align: middle;} if text fits one line 回答2: