Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
274 views
in Technique[技术] by (71.8m points)

html - How to vertically align the checkboxes with CSS

You if run this code you will see that check boxes are aligned vertically so I want a solution to vertically align these checkboxes

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" href="css/style.css" />
  <title>To-Do-List</title>
</head>

//the body section

<body>
  <div class="box" id="dBox">
    <p>
      <%= dayIs %>
    </p>
  </div>
  // the List items generated by express and EJS
  <div class="box" id="listBox">
    <%if(newItems.length >=0){ %>
      <% for(var i=0; i<=newItems.length-1 ;i++){
      %>
        // This is the part where I am confused that how to align the checkboxes vertically
        <div>
          <input type="checkbox" id="item" />
          <p id="item">
            <%= newItems[i] %>
          </p>
        </div>
        <%}%>
          <%}%>
            <form action="/" method="POST">
              <input type="text" name="item" value="" autocomplete="off" />
              <button type="submit">Add</button>
            </form>
  </div>
</body>

</html>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...