• # 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 2:15 pm

    Just curious, why do you care about the minor indentation problem?

    I’ve had the same result happen before due to PHP but nothing that I really cared to worry about.

    # January 8, 2013 at 2:39 pm

    If you are including files via PHP, you’re definitely going to get odd indentation.

    # January 8, 2013 at 2:57 pm

    In Notepad++, try to paste it, remove all the white space and re-indent the code.

    # 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.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.