Help line up label for checkbox with checkbox

I don’t know why I can’t position my checkbox next to the label, I’ve tried a hundred different ways. I would like the checkbox right after the word “issue”.


My full code on glitch.
In /views/index.html:

<form id="testForm2" class="border">
        <input type="text" name="_id" placeholder="*_id" required=''><br>
        <input type="text" name="issue_title" placeholder="(opt)Title"><br>
        <textarea type="text" name="issue_text" placeholder="(opt)Text" ></textarea><br>
        <input type="text" name="created_by" placeholder="(opt)Created by"><br>
        <input type="text" name="assigned_to" placeholder="(opt)Assigned to"><br>
        <input type="text" name="status_text" placeholder="(opt)Status text"><br>
        <!--this is the problem label and input-->
        <label for="close">Check to close issue</label>
        <input type="checkbox" name="close" id="close" value="false">
        <button type="submit" class="btn btn-primary btn-block">Submit Update</button>
      </form><br>

In /public/style.css:

#testui {
  display: flex;
  flex-direction: column;
  align-items: center;
} 
#testForm, #testForm2, #testForm3 {
  width: 60%;
  margin-bottom: 10px;
}
@media only screen and (max-width: 400px) {
  #testForm, #testForm2, #testForm3 {
    width: 90%;
  }
  #allIssues {
    width: 90%;
  }
}

input, textarea {
  width: 100%;
}

Hi,

This is because all the input tags have width 100% of parent.

Your code:

input, textarea {
  width: 100%;
}

Try to comment the width property:

input, textarea {
  //* width: 100%; */
}
1 Like

Thanks @timagixe, that fixed it! It changed some of the other styling I wanted but I can easily make the other adjustments.