Pressing enter in html


why can't we write codes in html without pressing enter i.e. why we need to press enter and can't write codes continuously


Code readability, seriously, if you write everything on one line, no one wants to work with your code. Here is a compressed css file (link), good luck finding something, finding where it belongs too.

No offense, but code readability is really important :slightly_smiling:


thanks for your reply. I got that readability is necessary in coding but i just wanted to know that does it work as valid instruction if we put them in the same line or by mistake write some lines without pressing enter.


Oh yes, all the enters are just for readability, the computer ignores it (and all the additional spaces + tabs), so if you forgot a enter somewhere it is fine. You can put a whole lot of code on one line.


thanks a lot. it was of great help as i started any language for the first time.