Start Date

vertical-align isn't bringing my fields to the top of the DIV

21 просмотра

2 ответа

0 Репутация автора

I’m trying to align search fields. All my elements are within a parent container, which has the style

#statSearchFields {
    vertical-align: top;
    font-size: 90%;

The elements themselves have look like

<div class="searchField">
Start Date<br>
<input type="text" name="start_date" id="start_date" value="06/28/2014" placeholder="Start Date" class="datepicker hasDatepicker">

but when I put them in my container, they appear off-center. Here is the example fiddle — . How do I bring everything into alignment?

Автор: user6447029 Источник Размещён: 22.08.2016 08:33

Ответы (2)

0 плюса

4762 Репутация автора

vertical-align: top isn't being inherited from your ID. Add the following to your CSS and you will have the results you would expect.

.searchField {
  display: inline-block;

Note: You should remove the vertical-align property from your #statSearchFields ID.

Автор: Robert Размещён: 22.08.2016 08:40

0 плюса

86 Репутация автора


You have to add vertical-align: top; to the .searchField selector.

Updated jsfiddle:

Автор: Paweł Dymek Размещён: 22.08.2016 08:41
Вопросы из категории :