vertical-alignment

Why, when I center an image in a div with line-height, does a 3px gap appear at the top?

Have a look at this page. The images on the right should be centered within their divs. But if you look closely, there's a small border of around 3 pixels at the top. And if you disable the overflow: hidden (through firebug or the IE8 equivalent), it sticks out the bottom. The HTML is this: <div class="small"> <img src="/images/pho...

sIFR3 + opera = random element changes vertical poisition

I'm trying to make a horizontal menu using sIFR3 and it's making a strange thing in Opera (only). It moves one random element (never the first one though) a bit lower than the rest. I tried to check it out with adding a border-bottom, but it turns out to be a straight line. The elements are h2's, but the same problem is with span or any ...

Flex - Vertical Align Cells in a Datagrid

I'm having trouble vertical aligning text inside cells in a DataGrid in Flex. I tried this.setStyle("vertical-align", "middle) in an itemRenderer on the column but it doesn't seem to work... I tried verticalAlign as well. ...

Best way to create a div with Label: Textbox and have it nicely centered?

What's the best way to have the following? Name: [Textbox] Inside a div? I find that the Name: part doesn't center nicely with the textbox, especially with a small font. I want the Name: part to be centered vertically. In some cases, the left hand part can be quite long and wrap onto multiple lines, like this: All known addresses: ...

Vertical-align image in a fixed-height block

I'm trying to BOTTOM align an image in a fixed-height block: div { float: left; width: 100px; height: 100px; line-height: 100px; } div img { vertical-align: middle; } ...works in modern browsers, except IE! IE sucks no wonder, but I really need a fix, if possible. Edited to add: Can't use tables or background image. Many thanks ...

Vertical alignment (for IE!)

HTML: <div class="product"> <a href="#" class="thumb"><img src="img/thumb_md.png" alt="" /></a> </div> CSS: .product .thumb { position: relative; display: table-cell; vertical-align: bottom; height: 130px; } ..works great in modern browser, except, ofcourse, IE! Is there any workaround? The other solution I tried w...

Text vertical alignment in WPF TextBlock

How to make vertical center alignment to the text inside a TextBlock? I found TextAlignment property. But it is for horizontal text alignment. How to do it for vertical text alignment. ...

Vertical-align image

I have a div that contains an image and a p tag (seen below). I want to align the image in the middle of the div vertically depending on how many lines the paragraph is. Vertical-align doesn't work. I am using JavaScript right now to figure out how much to add to margin-top, but would rather use CSS. Any ideas? <div> <img> <p>Mu...

Align list of images using CSS

Hi, I would like to align a list of images to 'bottom', how can I achieve this using CSS? Background: I want a set of photos to be aligned to the bottom, the images are in different sizes. <div> <ul> <li> <!-- image 1--> <li> <!-- image 2--> <li> <!-- image 3--> </ul> </div> Thanks. ...

How to position div vertically using YUI grids?

Hi, I am using YUI grids for layout design. I want to position col3 vertically, and make it always stick to the bottom of the page. How to do that? I cannot find any online documentation about vertical positioning in YUI grids. Hope someone can shed some light on this :) ...

Completely center an image?

I have a div and an image within the div. The image size will vary. I want it to be centered horizontally and vertically. Css verticle align does't seem to work. Any tricks? I can use php, css or Jquery ...

How do I align text/images on bottom/right/center/middle of a container using the blueprint css framework?

Is there some easy way to align stuff in div containers to the right or bottom: <div class="span-24 align-right last">Text appears on the right side of the layout</div> or: <div class="span-2" id="lots-of-content"></div><div class="span-22 last bottom">Appears at bottom of container</div> or: <div class="span-24 vertical-middle la...

ASP.Net vertical alignment of controls in a panel

I have a Panel with the following: <asp:Panel ID="Panel1" runat="server" Height="101px"> Day <asp:DropDownList ID="DropDownList1" runat="server" Height="24px" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"> </asp:DropDownList> &nbsp;Hour <asp:DropDownList ID="DropDownList2" runat="server"> </asp:Drop...

Orient text vertically in HTML like in Excel

I'm trying to replicate Excel's Vertical Text feature in HTML and wondering if anyone has tried this or knows of an easy way to do this? I want my text to look like: T H I S inside of a <th> element ...

vertical align for text fields

Hi all, how can I align (vertically) some text input fields with CSS? eg in the following: <form action='<?= $_SERVER['PHP_SELF']; ?>' method='post'> <p><label for='username' class=''>Username:</label> <input type='text' name='username' id='username' class='field' value='' tabindex='10' /></p> <p><label for='password' ...

CSS boxes will not float from lower right corner

Hi there, I've been searching for this solution for a while now... [bla bla... google.. bla]... I have created an example where I'm almost there, but not quite: http://www.mikael-sandbox.com/puzzlecss/ What I have left here is that I want the number 1 to always be in the lower right corner. This is the case as long as I have ONE singl...

WPF alignment stretch

Can someone help me understand the WPF stretch alignment. I often run into issues where I want a control to fill an area but I never understand on what level I should put the VerticalAlignment="Stretch". Specially when UserControls are involved. I always solve the problem by trying different things or putting stretch on all levels but I...

vertical align not working

is it possible to vertically align an image coming inside an anchor tag ? I am using two anchor tags inside a DIV.. each one should vertically align to center. in one I am using an image in another one text ? PS: without line-height ...

Table item vertical-alignment change when adding control inside TD

I have been wondering about this. Why does the alignment of the td gets affected when placing controls inside it. For example. <tr> <td>Row 1</td> <td> <input type="text" /> <input type="button" value="Select" /> </td> <td>Selected Value 1</td> </tr> <tr> <td>Row 2</td> <td colspan="2"> <input type="text" /> ...

Centering element inside an element (jQuery)

<div class="preview"> <span class="center">This will be centered</div> </div> Preview has fixed width (120x120), but span may contain anything (image, text). How do I center it vertically and horizontally using jQuery? I looked up some snippets but they all center elements inside the 'body' not another element. I'd like to avoid use ...