雖然,這可能是依賴於瀏覽器版本,瀏覽器通常具備的input
元素,這些CSS規則:
-webkit-appearance: textfield;
background-color: white;
border-image-source: initial;
border-image-slice: initial;
border-image-width: initial;
border-image-outset: initial;
border-image-repeat: initial;
-webkit-rtl-ordering: logical;
-webkit-user-select: text;
cursor: auto;
padding: 1px;
border: 2px inset;
這些爲input
,textarea
,keygen
,select
,button
:
text-rendering: auto;
color: initial;
letter-spacing: normal;
word-spacing: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
display: inline-block;
text-align: start;
margin: 0em 0em 0em 0em;
font: 13.3333px Arial;
這對於input
,textarea
,keygen
,select
,button
,meter
,progress
:
-webkit-writing-mode: horizontal-tb;
所以,這與瀏覽器樣式表規則無關。
UPDATE
如果添加一個空白樣
位於它們之間的會出現差距。
根據不同的情況,可以使用以下兩種方法來擺脫的差距:
- 添加負
margin-left
- 使用float
取出之間的空白元素,可以做到:
1-把主題放在一行
<input type="text"><input type="text"><input type="text">
2-刪除空間(不要擔心,它是正確的!:))
<input type="text"><
input type="text"><
input type="text">
3-使用HTML註釋
<input type="text"><!--
--><input type="text">
我建議你使用1號方法(把主題在一行中),但無論是將工作。
謝謝你的答案,但我該如何解決這個問題? –
U R歡迎。不,上述規則是Google Chrome的默認設置。請嘗試編輯您的問題,並在「輸入」周圍添加更多範圍的HTML元素,並使用相關的CSS規則來幫助我改進答案。 – Trix
@LouisTran我發現了問題,請檢查我的更新答案,在一分鐘內 – Trix