vertical-alignment

Vertically align smaller bullets with larger text

北战南征 提交于 2019-12-03 23:00:39
I have a list with bullets. I made the bullets smaller by putting the li text inside a span and making the font-size of the li smaller than that of the span. The problem is that now the bullets are not vertically aligned in relation to the text. How do I fix that? HTML: <ul> <li><span>text1</span></li> <li><span>text2</span></li> <li><span>text3</span></li> <li><span>text4</span></li> </ul> CSS: li{ font-size: 15px; } li span{ font-size: 25px; } jsFiddle: http://jsfiddle.net/tXzcA/ You could just make your own bullet point and make it whatever size you want. li{ font-size: 15px; list-style

Vertical align using jquery for all devices?

孤者浪人 提交于 2019-12-03 20:20:03
I found as problematic thing to align vertically some elements on page, without changing some others elements layouts. The problem is magnified on mobile devices. So many screen sizes, resolutions, portrait, landscape... var x=window.innerHeight - $('#myDiv').height(); $('#myDiv').css ('margin-top', x/2); This should be ok for all devices, mobile and desktop. Do you see any downside of these approach? As I understand, all devices today support JavaScript. But, is it possible that some device supports JS but doesn't support jQuery ? You should use $('#myDiv').parent().height() instead of window

Bootstrap vertical align property not working

我是研究僧i 提交于 2019-12-03 18:16:38
问题 A very basic question from the documentation of Bootstrap. Everything seemed to have worked so far, except this vertical alignment . In the following images u can see How it should be and How it appears in my browser... Thanks in advanced, for any help. <div class="container"> <div class="row"> <div class="col align-self-start"> One of three columns </div> <div class="col align-self-center"> One of three columns </div> <div class="col align-self-end"> One of three columns </div> </div> </div>

CSS3 transform rotate text, fixed position left and right, vertically centered

狂风中的少年 提交于 2019-12-03 17:37:01
问题 I'm trying to position one element to the left and one to the right of the browser window, both contains an ul with CSS transform rotate. I have managed to position .rotate-left and its ul to the left, but I have been unable to position the ul inside .rotate-right to the right. (It needs to be visible on a horizontal line from right to left if transform is not supported.) CSS: .rotate-left ul li, .rotate-right ul li { display: inline; } .rotate-left { position: fixed; top: 0; left: 0; bottom:

How to align on the right an inline-block element?

大城市里の小女人 提交于 2019-12-03 16:58:46
问题 As you can see in the following Fiddle: http://jsfiddle.net/EvWc4/3/, I'm currently searching a way to align the second link (link-alt) to the right side of its parent (p). Why not using float or position:absolute you'll say, well the main reason is that I like the fact that the links' display (inline-block) property allow them to be verticaly aligned in a naturally kind of way. By using float or position:absolute; I'll be forced to calculate and put some extra margin-top or top value to

TextBlock text not vertically centering within DataGridCell

纵饮孤独 提交于 2019-12-03 16:01:06
I'm creating a DataGrid in C# (from code-behind/not XAML), but no matter what I try, I can't get the text to be vertically center in the data cells: I started off with: var CellStyle = new Style(typeof(DataGridCell)) { Setters = { new Setter(TextBlock.TextAlignmentProperty, TextAlignment.Center) } }; Which correctly targets the cell and horizontally centres the text (per the screenshot above). Trying to vertically center the text, I know that a TextBlock doesn't support vertical content alignment, only its own vertical alignment within a parent element. Per this question ( Text vertical

How to vertically center align background image with text?

白昼怎懂夜的黑 提交于 2019-12-03 15:14:47
问题 I am having trouble vertically aligning background image with text, without assigning constant (and hence, not automatic and reusable) values to height or line-height . I was wondering if there actually is a way to vertically center align bg image of, say and a element , with its text without assigning constant values to line-height or height`? A live demo is available here: http://cssdesk.com/8Jsx2. Here's the HTML: <a class="">background-position: center</a> <a class="contain">background

Vertically center image when image is higher than container

旧街凉风 提交于 2019-12-03 13:12:05
问题 I have a responsive design with a header image which is placed in a container. The image has width:100%; and height:auto; so it grows as you enlarge the viewport. I don't want to exceed a certain height so the container has a max-height . The image still grows but now the bottom part is cut off now because it aligns to the top of the container. I would like the image to stay vertically centered in it's container so that parts of the image are cut off at the top and at the bottom. The outcome

CSS how to position element in half height (vertical 50%)

纵饮孤独 提交于 2019-12-03 12:34:01
I'm looking forward to build a tooltip which is positioned next to the element. It's easy to put it over and under in the center of element. But is there a way to do so vertically (on the right or left side of element vertically positioned in a middle of elements height)? For my purpose, height of the element is known & height of tooltip is not. And tooltip can be a child of element. But, I'm also curious about how to do it when both heights are unknown. By heights I understand element's and tooltip's height. Width can be known and fixed. This is pretty late but I tried to make an example on

Vertically align content of Bootstrap 3 column

血红的双手。 提交于 2019-12-03 10:49:51
After coming back to web-development after a four year hiatus, I am having a tough time vertically aligning the contents of a bootstrap 3 column with the next column. I have tried searching this site as well as generic searches in general and have just not come up with the right solution ... or my search terms are poor. In the HTML/CSS below, I would like to vertically center the "Page Title" text in the left column. I would like to keep the HTML and CSS as concise as possible while using the Bootstrap 3 CSS, so I just think I am completely missing something simple. HTML <div class="row page