Extra indent when viewing source code in browser
# January 8, 2013 at 1:44 pm
When I view my source code in a browser (i.e., Chrome and Opera), I’m getting extra indents in random spots of my code. Although I’ve formatted the code to my liking in my text editors of choice, both Chrome and Opera don’t seem to be fully honoring this formatting. I don’t get this issue when I view my code in FF, however.
My initial inclination was that this issue was stemming from the text editor in which I wrote and formatted the code. The text editor I used initially was Dreamweaver. When I copied my code to Notepad++, however, and viewed my source code in both of the aforementioned browsers, I still had the same issue.
Has anyone dealt with this issue before and if so how did you solve it? Thanks for any help or suggestions.# January 8, 2013 at 3:55 pm
You may be seeing tabs and not spaces. Most text editors have a setting to show tabs as X-number of spaces. For instance, let’s say your text editor is set to show a tab as 2 spaces while a browser source viewer would render a tab as 4 spaces.This is where the inconsistency would arise. Also, most text editors have a setting to automatically convert tabs to spaces on save, which would eliminate the inconsistency (if that’s what’s actually causing it).
As I haven’t seen your site, this is just speculation.
You must be logged in to reply to this topic.