Soldato
- Joined
- 12 Feb 2006
- Posts
- 17,662
- Location
- Surrey
ok this has just bugged me for the last time so i will be finding a solution to it so i can finally say hasta la vista baby to it once and for all.
when i am writing away i like to add white space to my code to keep it neat, however white space in code sometimes adds white space on the page, e.g.
this will be displayed with a space between the input text field and the submit button. annoyingly i will forget this and spend far too long looking why there is a 2px margin between the fields, to eventually remember it's because there is a space in the code.
how can i stop this from happening in the future? i want to have the white space to keep the code neat and i am sure i will be doing it again any way so i really will be so grateful to whoever gives me the answer
thank you
when i am writing away i like to add white space to my code to keep it neat, however white space in code sometimes adds white space on the page, e.g.
Code:
<form action=''>
<label for='field1'>Search our Site</label>
<input type='text' class='field1' id='field1' name='keyword'/>
<input type='submit' class='field2' value='search' />
</form>
this will be displayed with a space between the input text field and the submit button. annoyingly i will forget this and spend far too long looking why there is a 2px margin between the fields, to eventually remember it's because there is a space in the code.
how can i stop this from happening in the future? i want to have the white space to keep the code neat and i am sure i will be doing it again any way so i really will be so grateful to whoever gives me the answer

thank you