0

I am having trouble getting an input element and a button to align correctly. This is what it looks like:

Notice the bottom alignment of button and input

This comes from the following code:

<div class="row">
     <div class="offset1 span6">
          <input type="text" class="l_input" placeholder="enter a city"></input>
     </div>
     <div class="span3"> 
          <button class="l_button btn btn-primary" type="button">Search</button>
     </div>
</div>

I want the input height to be the same as the button, which is not the case currently. I assume this is because of margins/padding, so I tried to set them to 0 px in my css: but it has no impact.

.l_input {
 padding: 0px;
 margin: 0px;
 }

What do I need to do to get the height of the input to be aligned with the height of the search button?

Siddharth Ram
  • 546
  • 5
  • 15

1 Answers1

0

You are almost right, but the margins and padding are in the other element. Try:

.l_input,
.l_button {
    padding: 0px;
    margin: 0px;
}

updated demo

vals
  • 61,425
  • 11
  • 89
  • 138