HTML标记属性有ORDER

时间:2017-06-08 04:47:13

标签: html input attributes tags

我为输入标签尝试了相同的属性但是顺序不同,布局会有所不同。我认为标签的属性没有顺序,你能解释一下吗? 顺便说一下,类字段如下:

.field {
  font-family: "MS UI Gothic";
  font-size: 12px;
  height: 17px;
  border: 1px solid #ADD566;
  readonly: false;
}

Input1标签:

input1.jpg

Input2标签:

enter image description here

   .field {
	  font-family: "MS UI Gothic";
	  font-size: 12px;
	  height: 17px;
	  border: 1px solid #ADD566;
	  readonly: false;
    }
Input1 tag:

	<input name="code" size="9" maxlength="6" type="text" onChange="javascript:this.value=this.value.toUpperCase();" style="ime-mode:disabled; text-transform:uppercase" class="field" value="">

Input2 tag:

	<input name="code" size="9" maxlength="6" type="text" class="field" onChange="javascript:this.value=this.value.toUpperCase();" style="ime-mode:disabled; text-transform:uppercase" value="">

1 个答案:

答案 0 :(得分:3)

课前有一个特殊字符(U+3000 : IDEOGRAPHIC SPACE),仅使用空格(U+0020 : SPACE [SP])。

  

您可以在此处进行测试:http://www.babelstone.co.uk/Unicode/whatisit.html

您的代码:

&#13;
&#13;
.field {
  font-family: "MS UI Gothic";
  font-size: 12px;
  height: 17px;
  border: 1px solid #ADD566 !important;
  readonly: false;
}
&#13;
 Input1 tag:
<input name="code" size="9" maxlength="6" type="text" onChange="javascript:this.value=this.value.toUpperCase();" style="ime-mode:disabled; text-transform:uppercase" class="field" value="">
Input2 tag:
<input name="code" size="9" maxlength="6" type="text" class="field" onChange="javascript:this.value=this.value.toUpperCase();" style="ime-mode:disabled; text-transform:uppercase" value="">
&#13;
&#13;
&#13;

用空格替换后:

&#13;
&#13;
.field {
  font-family: "MS UI Gothic";
  font-size: 12px;
  height: 17px;
  border: 1px solid #ADD566 !important;
  readonly: false;
}
&#13;
Input1 tag:
<input name="code" size="9" maxlength="6" type="text" onChange="javascript:this.value=this.value.toUpperCase();" style="ime-mode:disabled; text-transform:uppercase" class="field" value="">
Input2 tag:
<input name="code" size="9" maxlength="6" type="text" class="field" onChange="javascript:this.value=this.value.toUpperCase();" style="ime-mode:disabled; text-transform:uppercase" value="">
&#13;
&#13;
&#13;