Answer the question
In order to leave comments, you need to log in
Why does line wrapping in code affect page appearance?
Hello. The question arose: why such a code: <button ></button><input>
And such a code:
<button ></button>
<input>
Answer the question
In order to leave comments, you need to log in
button and input have display: inline-block by default, so they behave somewhat like plain text on the page, hence:
merged
text separate text
Because spaces and line breaks are also characters and they count. The document needs somewhere to store the information that "there are 2 spaces and here is a line break" so it stores it :)
Why this is so, has already been written above. You can fix this with a zero font size - but it's better to just use the first option.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question