Take the 2-minute tour ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.

I've always been used to write my own CSS but I decided to give a go to and I want to make sure I'm not using more HTML containers that I need to:

This is my code for a single element of a list:

<div class="row form-group">
  <div class="col-md-4">
     <input type="email" class="form-control" placeholder="Enter email" value="[email protected]">
   </div>
   <div class="col-md-2">
      <span class="glyphicon glyphicon-minus"></span>
   </div>
</div>

My main issue with this is to have two <div> wrapping single elements, in the first case it's an <input> and then a <span>. If this was normal HTML I would condemn the DOM code as being inefficient and cluttered as the <div> would not be necessary.

Is this a proper usage of if I want to create a form group element where the left side is an input and the right side the - icon?

share|improve this question
    
This seems pretty consistent with Bootstrap. Have you considered not using Bootstrap? –  cimmanon Sep 9 at 2:07
    
Well, this is a simple scenario, so bootstrap would be used in a larger context. If you think this is OK and no code review is needed, no other way to improve this code, add it as an answer and I'll upvote. –  bitoiu Sep 10 at 9:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.