A strange problem with spaced in the notepad file

Hi Guys - my first post.

I have a very strange problem. In my PHP file (opens as ANSI file, I tried to change to UTF-8 in notepad and save but this caused errors).

Anyway, in the PHP file, I have two divs which are positioned inline within a container div. The code is like so:

...
...

Now, when the code is written like this, a space is inserted between #logo and #nav in the browser, even though they have no padding, margins, borders, and the widths all add up correctly.

When I change the code to this:

...
...

It’s fine. It seems that a text space is being inserted in the first example. However, I thought text spaced in Notepad were ignored unless you use   ? Obviously I don’t want to have to position all my code inline as it will be a nightmare to format.

This only seems to happen in the PHP file so thought I would ask here?

Thanks,
John

Do you absolutely need to use inline-block instead of float? You could try the font-size hack.

#masthead {
font-size: 0;
}

Awesome - I’ve read around this topic some more - seems like the font-size: 0, or margin-left: -0.3em, etc, will work.

Thanks!

John

Sponsor our Newsletter | Privacy Policy | Terms of Service