vertical-alignment

Vertical Align - List with “list-style-image”

浪尽此生 提交于 2019-11-29 13:41:24
Neither googling nor browsing in SO helped me - hope someone here can solve this : I have the following html : <ul> <li>ABC 1</li> <li>ABC 2</li> <li>ABC 3</li> <li>ABC 4</li> </ul> and css ul {list-style-image:url(../img/hook.png);} li {vertical-align:middle;color:#FFFFFF;font-size:16px;text-shadow: 0em 0.13em 0.13em #2A2A2A;font-family:Helvetica,Arial,Sans-Serif;font-weight:normal;} the "hook.png" image is 32x35 px - but whenever I create list items, text (e.g. ABC...) will always be shown below the image. Tried line-height and those 100% thingies - but neither worked out. Any quick help :/

Vertically Centering content in html [duplicate]

白昼怎懂夜的黑 提交于 2019-11-29 13:11:53
This question already has an answer here: How to align a <div> to the middle (horizontally/width) of the page [duplicate] 27 answers Center a DIV horizontally and vertically [duplicate] 7 answers I am trying to vertically center a <div> within a <body> The reason I'm trying to do this is because I'm trying to design a website that is in the style of the Windows 8 Metro start screen Does anyone know how this can be done? If you want center block verticaly you can use this trick's margin is a half of your size bloc. If you use this you need size on your bloc. html : <div id="center"></div> css :

CSS - vertically center an image within a floated div

倖福魔咒の 提交于 2019-11-29 12:41:59
问题 I've decided to throw in the towel on this problem and need some help :). As per title trying to vertically align an image wrapped in an anchor element in the center of a floated fixed height div. Done a lot of googling for solutions and the closet I can get is below when the div is not floated (however it needs to be). Any ideas would be greatfully appreciated! .class_name { /*float: left*/ width:153px; height:153px; margin:3px; padding:4px; border:1px solid #dedede; text-align: center;

Vertically center text in UILabel depending on actual visible letter height

本小妞迷上赌 提交于 2019-11-29 12:19:50
How can I vertically center a single letter in a UILabel considering the actual visible size of the letter, not the font size. For example, I need letters 'f' and 'o' to be exactly in the middle of the label. I have tried to render the label to an image, crop the transparent pixels and then set the center of the UIImageView BUT it always appears slightly more blurry than the actual label. How can this be achieved? Thanks in advance. I think you need to delve into core text to get the kind of glyph metrics needed to do this. Then, rather than trying to move the text inside the UILabel, you

Vertically center a div inside another div

感情迁移 提交于 2019-11-29 06:14:59
I'm trying to vertical-align: middle a div inside another div, but for some reason it's not working properly. What am I doing wrong? #wrapper { border: 1px solid red; width: 500px; height: 500px; } #block { border: 1px solid blue; width: 500px; height: 250px; vertical-align: middle; } <div id = 'wrapper'> <div id = 'block'> I'm Block </div> <div> PS: This is just an example, so no, I don't actually know the actual width and height of the divs, as they are dynamic, according to their contents, so please no margin-top: 125px, or padding-top: 125px answers, or answers like that. Michael_B The

How to vertically align two or more (side by side) elements in a div?

跟風遠走 提交于 2019-11-29 04:08:50
I am trying to vertically align two elements with different heights in a div: <div class="footer-icons"> <div id="footer-twitter"> <img src="images/twitter.png" width="40" alt=""> </div> <div id="footer-fb"> <div class="fb-like" data-href="http://facebook.com/user" data-send="false" data-layout="button_count" data-width="160" data-show-faces="false" data-font="arial"></div> </div> </div> The twitter div has a height of 40px, and the fb div has a height of 20px. What is currently happening is the fb div is vertically centered with the bottom edge of the twitter image. Here's the CSS: .footer

ListItem disc displaying at vertical bottom

别等时光非礼了梦想. 提交于 2019-11-29 03:42:28
I have a couple un-ordered lists on my page. Both lists use list-style: disc inside; . Each list's list-items have a couple div 's inside them. The problem is that the list-item's content takes up multiple lines and the disc is appearing vertically, at the bottom of the multi-line list-item. Here is a screenshot kind of showing the problem I am experiencing. Note that I stole the image from a similar question, it is not my HTML or CSS. Here is a striped down version of my HTML: <html> <head> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <div id="billing_form"> <div id

Bootstrap Vertical Align Image

落花浮王杯 提交于 2019-11-29 02:49:00
问题 On this website: http://www.livenews.surf/ I want to make news images and text vertically middle align, how i can do that? 回答1: The easiest solution is to use Flexbox (see spec. for more details on it's usage). For this particular case, assign a custom class to each of your content containing div (currently it only has .col-md-11 ), for example class "content" and add this code to your stylesheet .content { display: flex; align-items: center; flex-wrap: wrap; } Small code explanation: align

How to vertical align a text?

社会主义新天地 提交于 2019-11-29 02:46:59
问题 How to vertically align the text in a floated div? For example: I have a dynamic content with fixed height. if the content is small or big it has to automatically vertically align. Thanks 回答1: Table cells are the easiest solution. Javascript is an alternative (measure the size and text size of the div, then adjust padding, or lineheight, or whatever). edit: Or this awesome css: CSS div#container { border: solid 1px; height: 300px; } div#content { border: solid 1px; } div#balance { border:

Bootstrap how to get text to vertical align in a div container

核能气质少年 提交于 2019-11-29 02:03:24
问题 What is the best/proper way to vertically align the text in the middle of its column? The image height is statically set in the CSS. I have tried setting an outer div to display: table and an inner div to display: table-cell with vertical-align: middle but that didn't work either. HTML <section id="browse" class="browse"> <div class="container"> <div class="row"> <div class="col-md-5 col-sm-5"> <h2 class="text-left">Link up with other gamers all over the world who share the same tastes in