菜鸟笔记
提升您的技术认知

html代码中的标签换行造成间距问题-ag真人游戏


html代码:


css代码:

#hall_div_operation{
	clear: both;
	width: 389px;
	height: 60px;
	margin-top: 10px;
}
.hall_operation .label_input{
	float: left;
	font-size: 14px;
	padding-left: 10px;
}
.hall_operation .btn{
	width: 70px;
	float: left;
	margin-left: 10px;
}
#enterroombtn{
	background: #f7f8f8;
	color: #1c90f6;
	border: 1px solid #1c90f6;
	box-shadow: 0px 0px 2px #1c90f6;
}

方法一:不换行

方法二:设置父级块的字体大小为0

若其中还有字体需要显示的话,需要用标签去包裹它,然后再设置字体大小。

html代码:

css代码:

#hall_div_operation{
	clear: both;
	width: 389px;
	height: 60px;
	margin-top: 10px;
}
.hall_operation .label_input{
	float: left;
	padding-left: 10px;
	font-size: 0;
}
.hall_operation .label_input .span_font{
	font-size: 14px;
}
.hall_operation .btn{
	width: 70px;
	float: left;
	margin-left: 10px;
}
#enterroombtn{
	background: #f7f8f8;
	color: #1c90f6;
	border: 1px solid #1c90f6;
	box-shadow: 0px 0px 2px #1c90f6;
}

方法三:设置 margin-left 为-3px

html代码:

css代码:

#hall_div_operation{
	clear: both;
	width: 389px;
	height: 60px;
	margin-top: 10px;
}
.hall_operation .label_input{
	float: left;
	padding-left: 10px;
	font-size: 14px;
}
.hall_operation .label_input input{
	margin-left: -3px;
}
.hall_operation .btn{
	width: 70px;
	float: left;
	margin-left: 10px;
}
#enterroombtn{
	background: #f7f8f8;
	color: #1c90f6;
	border: 1px solid #1c90f6;
	box-shadow: 0px 0px 2px #1c90f6;
}



网站地图