怎么做?

码:
https://jsfiddle.net/6q352ysx/59/

它们的高度相同,但不均匀。

css - 将文本输入与提交按钮对齐-LMLPHP

这些中的哪一个会得到:

垂直对齐:顶部;

垂直对齐:底部;

还是只在其中之一上使用它?

那,或者我会用

vertical-align: middle;




input[type=text] {
  font-size: 22px;
  width: 200px;
  color: #0059dd;
  background: #000000;
  border: 1px solid #0059dd;
}

input[type=submit] {
  font-size: 22px;
  color: #0059dd;
  cursor: pointer;
  height: 31px;
  background: black;
  border: 1px solid #0059dd;
  font-family: "Times New Roman", Times, serif;
}

<div class="info">
  <input id="input" type="text" name="someNameHere" placeholder="someValueHere" />
  <input id="sent" type="submit" value="Set" />
</div>

最佳答案

试试这个CSS:

.info {display:flex}

input[type=text] {
  font-size: 22px;
  width: 200px;
  color: #0059dd;
  background: #000000;
  border: 1px solid #0059dd;
}

input[type=submit] {
  font-size: 22px;
  color: #0059dd;
  cursor: pointer;
  background: black;
  border: 1px solid #0059dd;
  font-family: "Times New Roman", Times, serif;
}


小提琴:https://jsfiddle.net/6q352ysx/11/

10-05 20:42
查看更多