Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to align a text input with an image button?

I have a form where the last line of input fields is followed by 2 image buttons.

No matter what I try I can't seem to horizontally align the buttons with the field.

Here's all the code: http://jsfiddle.net/h3ZPk/

like image 209
TheOne Avatar asked May 30 '12 19:05

TheOne


People also ask

How do you align a image along with the text?

Hold down Shift and use the mouse or touchpad to select the objects that you want to align. Select Shape Format or Picture Format. Select Align. If you don't see Align on the Shape Format tab, select Arrange, and then choose Align.

How do I align text and image in one line?

We need to create a parent element that contain both image and text. After declaring the parent element as flexbox using display: flex; we can align the items to the center using align-items: center;. Example: This example uses flexbox to vertically align text next to an image using CSS.

Does text-align work on buttons?

The text-align property applies to the horizontal placement of the text within the button, not the alignment of the button itself.


1 Answers

Add this rule:

#buttons img, #buttons input {
    vertical-align:bottom;
}

jsFiddle example.

like image 144
j08691 Avatar answered Dec 05 '22 02:12

j08691