Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在HTML/CSS/Bootstrap中居中输入字段_Html_Css - Fatal编程技术网

如何在HTML/CSS/Bootstrap中居中输入字段

如何在HTML/CSS/Bootstrap中居中输入字段,html,css,Html,Css,我正在参与自由代码夏令营的Pomotoro项目: 我试图将输入框居中,但没有取得多大成功。有人有什么想法吗 var-timeMin=0; var-timeSec=3; var timerIntervalID=null; 功能板(str,最大值){ str=str.toString(); 返回str.length

我正在参与自由代码夏令营的Pomotoro项目:

我试图将输入框居中,但没有取得多大成功。有人有什么想法吗

var-timeMin=0;
var-timeSec=3;
var timerIntervalID=null;
功能板(str,最大值){
str=str.toString();
返回str.length
.btn主{
宽度:15雷姆;
保证金:0.2rem;
身高:5雷姆;
}
.btn危险{
宽度:15雷姆;
保证金:0.2rem;
身高:5雷姆;
}
输入{
最大宽度:4rem;
文本对齐:居中;
显示:块;
保证金:0;
}

fccPomodoro
fccPomodoro
剩余时间:25分钟
启动波莫多罗
重置
会议记录:
秒数:
您可以

margin: 0 auto
在输入框上:

input {
    max-width: 4rem;
    text-align:center;
    display:block;
    margin:0 auto;
} 
你可以

margin: 0 auto
在输入框上:

input {
    max-width: 4rem;
    text-align:center;
    display:block;
    margin:0 auto;
} 

您是否尝试在中心标记内对输入标记进行编码

<center><input type="text" ></center>

您是否尝试将输入标记编码到中心标记中

<center><input type="text" ></center>

参见下面的CSS

var-timeMin=0;
var-timeSec=3;
var timerIntervalID=null;
功能板(str,最大值){
str=str.toString();
返回str.length
.btn主{
宽度:15雷姆;
保证金:0.2rem;
身高:5雷姆;
}
.btn危险{
宽度:15雷姆;
保证金:0.2rem;
身高:5雷姆;
}
.表格组{
文本对齐:居中;
} 
.表格组输入{
最大宽度:4rem;
显示:块;
边距:0自动0自动;
}

fccPomodoro
fccPomodoro
剩余时间:25分钟
启动波莫多罗
重置
会议记录:
秒数:
参见下面的CSS

var-timeMin=0;
var-timeSec=3;
var timerIntervalID=null;
功能板(str,最大值){
str=str.toString();
返回str.length
.btn主{
宽度:15雷姆;
边缘