6 Replies Latest reply: Mar 6, 2012 11:02 AM by Shan-Dysigns RSS

    Carriage Returns in HTML Code Creating Extra Spaces Between Elements

    Shan-Dysigns Community Member

      I've looked online all over and can't find the solution to my issue. I've found several pages explaining a similar event, but no solution.

       

      When placing many divs next to each other, I would like to visually view the code as one div per line: (see image) To get this, I have to use hard returns in my code (this method makes editing a lot easier visually). But doing so adds extra spacing between the divs which turns a 3 column set of thumbnails to 2 colums. I can fix this if I adjust the physical margins between the divs, but this can't be the only fix.

       

      with-carriage-returns.jpg

       

      The other fix is if I place the code back to back to back (see image): This makes the div's behave and appear as they should, but now the code is a visual mess because it's all cluttered.

       

      no-carriage-returns.jpg

      What I want is to be able to use as many carriage returns in my code and for browsers to disregard these types of line breaks in the code. So essentially, how can I get away from these extra spaces when using hard returns in code?