<分区>
<分区>
我想知道如何在我的页面上居中对齐我的输入。谢谢
<body>
<input id="ask" type="text" placeholder = "Ex: how tall is the Gateway Arch" onfocus="this.placeholder = ''" onblur="this.placeholder = 'Ex: how tall is the gateway arch'"/>
<style type="text/css">
#ask {
padding: 10px 10px 10px 6px;
font-size:45px;
background-color:#FAFAFA;
min-width: 500px;
padding: 0 auto;
border: 0 none;
</style>
</body>
最佳答案
您想居中对齐您的输入表单,对吗?那很容易。如果你想在 <body>
中居中任何东西标签或 <div>
标记,或者您想将输入表单本身居中,只需添加以下 css:
margin-left:auto;margin-right:auto;
尝试一些代码,例如:
input {margin-left:auto;margin-right:auto;}
关于css - 居中对齐输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32417761/