我有一个包含两个按钮和一段文字的 div ,我想通过更改它的 CSS 来垂直和水平居中其中的所有元素和内容。如何实现?
<style>
.middle {
What to type in here?
}
</style>
<div class="middle">
<p>Hello</p>
<br />
<input type="button" value="Button 1">
<br />
<input type="button" value="Button 2">
</div>
<input>
元素需要自闭合:<input type="button" value="Button 1" />
。 - Surreal Dreams