Lincoln Lincoln - 5 months ago 22
HTML Question

html add space before tag

I am trying to add space before an input tag, and I noticed that Chrome didn't render the whitespace. What can I do to add a space. My code is very straightforward:

Q: <input type="text" id="q">


notice the space between Q: and the tag. I will use JS if I absolutely have to, but pure HTML is much better.

Answer

If you would like a regular line whitespacing you can use <br> but if you mean the literal whitespace before the the input box, you can use a margin tag to give it more space.

E.g.

 #q{
        margin-left:10px;
    }
Comments