Bootstrap ejemplo barra de navegación anormal en mi máquina

I copied exactly the same code from official example http://twitter.github.com/bootstrap/examples/starter-template.html.

But on my machine something add 20px more to the space between navbar and content. I uploaded the pic.

enter image description here

Traté de cambiarlo a body { padding-top:40px; } and it's ok on pc, but the 20px appears again on mobile. So I cannot find out why. Please help me with that.

Edit: you can see my page on http://sheldon.sinaapp.com/stackoverflow

THE REAL REASON!!!

Some editor on Windows will add BOM to the start of file. It's invisible and used to notice the editor that it is utf-8 encoded.

Para más detalles de BOM, consulte nuestra página, Byte Order Mark(wiki)

In notepad++, you can use Encoding -> Encode in utf-8 without BOM.

preguntado el 24 de agosto de 12 a las 10:08

Can you post a link to your page so we can compare? -

@DaveR I deployed it to sheldon.sinaapp.com/stackoverflow. thx. -

1 Respuestas

Okay - I've worked out the problem. You have a line of whitespace before your <!DOCTYPE html> declaration. If you delete this line and move <!DOCTYPE html> to line 1, you'll be working fine!

I've managed to recreate the problem here:

Version with whitespace (http://jsfiddle.net/TW9JP/)

Version without whitespace (http://jsfiddle.net/z8DQB/)

Respondido 24 ago 12, 10:08

I don't have that line now on http://sheldon.sinaapp.com/stackoverflow. But still not fixed. The " " below body still there - hbrls

There is still one space! You need to have absolutely no characters before the doctype. - DaveR

where did you see the space. in chrome view source? - hbrls

what are you using to prepare your html files? because it seems there is some weird encoding stuff going on behind the scenes. - DaveR

Oh man . . . I'm running out of suggestions! - try downloading this from pastebin pastebin.com/jfVNKSSU rename the file extension to .html and upload to your server! - DaveR

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.