-1

I have the following tag with input text fields with labels

<div>

    Start Date:
    <input type="date" id="reportsStartDate">

    End Date:
    <input type="date" id="reportsEndDate">

</div>

and it looks like this

enter image description here

as you can see the labels for the text boxes are at the lower part of the text boxes. How do i set this so the labels are centered to the text boxes like below?

enter image description here

theBigOzzy
  • 77
  • 1
  • 1
  • 11

2 Answers2

0

Vertical-align: middle is needed. If your input is a display:inline-block it works.

depperm
  • 10,606
  • 4
  • 43
  • 67
Marcos Pérez Gude
  • 21,869
  • 4
  • 38
  • 69
-2

You can add padding to the labels align it with the same height as that of inputs for that you need to include say a and inside that give your labels.